diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d7328e..503c59d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,39 +41,40 @@ jobs: run: go run utils/ci.go build - name: Test run: go run utils/ci.go test --integration -v - mysqltest: - strategy: - fail-fast: false # dont' want one scenario failing to deprive us of feedback on the others - matrix: - go-version: [1.14.x, 1.15.x] - os: [ubuntu-latest] - runs-on: ${{ matrix.os }} - services: - mysql: - image: mysql:5.7 - env: - MYSQL_USER: godbledger - MYSQL_PASSWORD: password - MYSQL_DATABASE: ledger - MYSQL_ROOT_PASSWORD: password - ports: - - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s - steps: - - name: Verify MySQL connection - env: - PORT: ${{ job.services.mysql.ports[3306] }} - run: | - while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do - sleep 1 - done - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - name: Checkout code - uses: actions/checkout@v2 - - name: Build - run: go run utils/ci.go build - - name: Test - run: go run utils/ci.go test --mysql -v +# TODO: these mysql test currently bypass the end-to-end test pattern effectively testing only that configuration is loaded +# mysqltest: +# strategy: +# fail-fast: false # dont' want one scenario failing to deprive us of feedback on the others +# matrix: +# go-version: [1.14.x, 1.15.x] +# os: [ubuntu-latest] +# runs-on: ${{ matrix.os }} +# services: +# mysql: +# image: mysql:5.7 +# env: +# MYSQL_USER: godbledger +# MYSQL_PASSWORD: password +# MYSQL_DATABASE: ledger +# MYSQL_ROOT_PASSWORD: password +# ports: +# - 3306 +# options: --health-cmd="mysqladmin ping" --health-interval=10s +# steps: +# - name: Verify MySQL connection +# env: +# PORT: ${{ job.services.mysql.ports[3306] }} +# run: | +# while ! mysqladmin ping -h"127.0.0.1" -P"$PORT" --silent; do +# sleep 1 +# done +# - name: Install Go +# uses: actions/setup-go@v2 +# with: +# go-version: ${{ matrix.go-version }} +# - name: Checkout code +# uses: actions/checkout@v2 +# - name: Build +# run: go run utils/ci.go build +# - name: Test +# run: go run utils/ci.go test --mysql -v diff --git a/tests/mysql_test.go b/tests/mysql_test.go index 860af00..aeb85d5 100644 --- a/tests/mysql_test.go +++ b/tests/mysql_test.go @@ -1,7 +1,7 @@ // Package mysql performs full a end-to-end test for GoDBLedger specifically using a mysql backend, // including spinning up a server and making sure its running, and sending test data to verify -// +build mysql +// +build integration,mysql package tests @@ -16,6 +16,8 @@ import ( ) func TestMySQL(t *testing.T) { + assert.Fail(t, "MYSQL tests are not currently supported; testing mysql cannot be done in-process and requires additional work to enable") + return // Create a config from the defaults which would usually be created by the CLI library set := flag.NewFlagSet("test", 0) diff --git a/tests/secure_connection_test.go b/tests/secure_connection_test.go index 2905ec9..779aa00 100644 --- a/tests/secure_connection_test.go +++ b/tests/secure_connection_test.go @@ -1,6 +1,6 @@ // secure connection test establishes a connection using mutual tls, and sending test transaction to verify -// +build integration +// +build integration,secure package tests diff --git a/utils/ci.go b/utils/ci.go index e9ad1ae..1d62902 100644 --- a/utils/ci.go +++ b/utils/ci.go @@ -318,7 +318,8 @@ func doTest(cmdline []string) { coverage := flag.Bool("coverage", false, "Whether to record code coverage") verbose := flag.Bool("v", false, "Whether to log verbosely") integration := flag.Bool("integration", false, "Whether to run integration tests") - mysql := flag.Bool("mysql", false, "Whether to run mysql integration tests") + mysql := flag.Bool("mysql", false, "Whether to run mysql integration tests (not currently supported)") + secure := flag.Bool("secure", false, "Whether to run secure integration tests") flag.CommandLine.Parse(cmdline) env := build.Env() @@ -339,7 +340,10 @@ func doTest(cmdline []string) { gotest.Args = append(gotest.Args, "-tags=integration") } if *mysql { - gotest.Args = append(gotest.Args, "-tags=mysql") + gotest.Args = append(gotest.Args, "-tags=integration,mysql") + } + if *secure { + gotest.Args = append(gotest.Args, "-tags=integration,secure") } if *verbose { gotest.Args = append(gotest.Args, "-v")