Skip to content

Commit 3440315

Browse files
committed
test: 7zipped demos
1 parent 2e46b12 commit 3440315

File tree

9 files changed

+21
-17
lines changed

9 files changed

+21
-17
lines changed

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ matrix:
1414
env:
1515
- GO111MODULE=on
1616

17+
before_install:
18+
# install 7zip for decompressing test demos
19+
- sudo apt-get install -y p7zip-full
20+
1721
# Override Travis's default 'go get' step, since we use Go modules
1822
install:
1923
- go mod download
@@ -29,9 +33,6 @@ before_script:
2933
# Install golangci-lint
3034
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $GOPATH/bin v1.17.1
3135

32-
# Download test data
33-
- pushd test/cs-demos && git lfs pull -I '*' && popd
34-
3536
script:
3637
# Compile
3738
- bin/build.sh

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ Running unit tests:
189189
#### Regression tests
190190

191191
For the full regression suite you will need to download the test demo-set.
192-
For this, [Git LFS](https://git-lfs.github.com) is required.
192+
193+
Prerequisites:
194+
- [Git LFS](https://git-lfs.github.com) must be installed
195+
- [`7z`](https://www.7-zip.org/) must be in your `PATH` environment variable (`p7zip` package on most Linux distros)
193196

194197
Downloading demos + running regression tests:
195198

bin/coverage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
bin/download-test-data.sh
5+
bin/download-test-data.sh default.7z unexpected_end_of_demo.7z regression-set.7z
66

77
# don't cover mocks and generated protobuf code
88
coverpkg_ignore='/(fake|msg)'

bin/download-test-data.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22

33
set -e
44

5-
echo 'downloading/updating test data (~ 1 GB), this may take a while ...'
5+
echo "downloading/updating '$@', this may take a while ..."
66

77
git submodule init
88
git submodule update
99

1010
pushd test/cs-demos >/dev/null
11-
git lfs pull -I '*'
11+
12+
for f in "$@"; do
13+
git lfs pull -I $f
14+
7z x $f -aoa
15+
done
16+
1217
popd >/dev/null
1318

1419
echo 'download complete'

bin/git-hooks/link-git-hooks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ echo -n 'this will download ~ 1 GB of test-data (if not already done) [y/N] '
3333

3434
read prePushYesNo
3535
if [[ "$prePushYesNo" == "y" || "$prePushYesNo" == "Y" ]]; then
36-
bin/download-test-data.sh
36+
bin/download-test-data.sh default.7z unexpected_end_of_demo.7z regression-set.7z
3737
link .git/hooks/pre-push ../../bin/git-hooks/pre-push.sh
3838
echo 'added pre-push hook'
3939
fi

bin/race-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ go test -v -race -short ./... -timeout 15m
88

99
# run TestDemoInfoCs which is skipped by -short
1010
# so we at least check one demo with race tests
11+
bin/download-test-data.sh default.7z
1112
go test -v -race -run TestDemoInfoCs . -timeout 15m

bin/regression-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
set -e
44

5-
bin/download-test-data.sh
5+
bin/download-test-data.sh default.7z unexpected_end_of_demo.7z regression-set.7z
66

77
go test ./...

demoinfocs_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ const unexpectedEndOfDemoPath = csDemosPath + "/unexpected_end_of_demo.dem"
3434

3535
var concurrentDemos = flag.Int("concurrentdemos", 2, "The `number` of current demos")
3636

37-
func init() {
38-
if _, err := os.Stat(defaultDemPath); err != nil {
39-
panic(fmt.Sprintf("Failed to read test demo %q", defaultDemPath))
40-
}
41-
}
42-
4337
var update = flag.Bool("update", false, "update .golden files")
4438

4539
func TestDemoInfoCs(t *testing.T) {
@@ -153,7 +147,7 @@ func TestDemoInfoCs(t *testing.T) {
153147

154148
func TestUnexpectedEndOfDemo(t *testing.T) {
155149
if testing.Short() {
156-
t.Skip("skipping test")
150+
t.Skip("skipping test due to -short flag")
157151
}
158152

159153
f := openFile(t, unexpectedEndOfDemoPath)

test/cs-demos

Submodule cs-demos updated from 4628815 to fd76b0a

0 commit comments

Comments
 (0)