add functional tests to github actions

This commit is contained in:
Ben McClelland
2023-06-23 18:32:34 -07:00
parent f84cfe58e7
commit c4f5f958eb
3 changed files with 35 additions and 0 deletions

31
.github/workflows/functional.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: functional tests
on: pull_request
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build
run: make
- name: Test
run: |
mkdir /tmp/gw
./versitygw -a user -s pass posix /tmp/gw &
sleep 1
./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow

1
.gitignore vendored
View File

@@ -32,3 +32,4 @@ VERSION
/versitygw.spec
*.tar
*.tar.gz
/rand.data

View File

@@ -285,6 +285,9 @@ func getAction(tf testFunc) func(*cli.Context) error {
fmt.Println()
fmt.Println("RAN:", integration.RunCount, "PASS:", integration.PassCount, "FAIL:", integration.FailCount)
if integration.FailCount > 0 {
return fmt.Errorf("test failed with %v errors", integration.FailCount)
}
return nil
}
}