From 027474797b3cb711c63ca5f7a918df7e3909926f Mon Sep 17 00:00:00 2001 From: b1ron Date: Wed, 14 Feb 2024 17:44:19 +0100 Subject: [PATCH 01/14] wip --- .github/workflows/dance.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index efa8f3619..18e38bbca 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -72,6 +72,9 @@ jobs: - restheart-auth - ycsb-workloada - ycsb-workloadc + auth: + - new + - old steps: - name: Checkout code From 2a603048093305ad54d3977dd66f670fc7455f3c Mon Sep 17 00:00:00 2001 From: b1ron Date: Sun, 18 Feb 2024 21:10:11 +0100 Subject: [PATCH 02/14] test --- .github/workflows/dance.yml | 14 +++++++++++--- docker-compose.yml | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index 18e38bbca..eae25b686 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -48,7 +48,6 @@ jobs: # - dbaas_core-1 # - dbaas_core-2 # - dbaas_core-3 - # - diff - dotnet-example - dotnet-example-auth - dotnet-example-auth-scram-sha-1 @@ -73,8 +72,8 @@ jobs: - ycsb-workloada - ycsb-workloadc auth: - - new - old + - new steps: - name: Checkout code @@ -97,10 +96,19 @@ jobs: run: go generate -x working-directory: tools - - name: Start environment + - name: Start environment with New Authentication + if: ${{ matrix.auth == 'new' }} + env: + FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main + NEW_AUTH: true run: bin/task env-up-detach DB=${{ matrix.db }} + + - name: Start environment with Old Authentication + if: ${{ matrix.auth == 'old' }} env: FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main + NEW_AUTH: false + run: bin/task env-up-detach DB=${{ matrix.db }} - name: Run init run: bin/task init diff --git a/docker-compose.yml b/docker-compose.yml index 1d3838e75..5e33adfa3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: - FERRETDB_HANDLER=postgresql - FERRETDB_POSTGRESQL_URL=postgres://user@postgres:5432/dance - FERRETDB_REPL_SET_NAME=rs0 - - FERRETDB_TEST_ENABLE_NEW_AUTH=true + - FERRETDB_TEST_ENABLE_NEW_AUTH=${NEW_AUTH:-false} extra_hosts: - "host.docker.internal:host-gateway" @@ -29,7 +29,7 @@ services: - FERRETDB_HANDLER=sqlite - FERRETDB_SQLITE_URL=file:/state/?_pragma=busy_timeout(20000) - FERRETDB_REPL_SET_NAME=rs0 - - FERRETDB_TEST_ENABLE_NEW_AUTH=true + - FERRETDB_TEST_ENABLE_NEW_AUTH=${NEW_AUTH:-false} extra_hosts: - "host.docker.internal:host-gateway" From 2f4e00fd07d3b2a6d4492048a9a97c35b389603b Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 10:25:51 +0100 Subject: [PATCH 03/14] update config to handle old and new auth --- internal/config/config.go | 43 +++++++++++++++++++++---------- internal/configload/configload.go | 36 ++++++++++++++++++-------- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 4761f9d61..7d958f845 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -68,9 +68,11 @@ type Config struct { // Results stores the expected test results for different databases. type Results struct { - PostgreSQL *TestConfig - SQLite *TestConfig - MongoDB *TestConfig + PostgreSQLOldAuth *TestConfig + PostgreSQLNewAuth *TestConfig + SQLiteOldAuth *TestConfig + SQLiteNewAuth *TestConfig + MongoDB *TestConfig } // TestConfig represents the configuration for tests categorized by status and regular expressions. @@ -128,18 +130,33 @@ const ( ) // ForDB returns the database-specific test configuration based on the provided dbName. -func (c *Config) ForDB(dbName string) (*TestConfig, error) { - return c.Results.forDB(dbName) +func (c *Config) ForDB(dbName string, newAuth bool) (*TestConfig, error) { + return c.Results.forDB(dbName, newAuth) } -func (r *Results) forDB(dbName string) (*TestConfig, error) { - switch dbName { - case "postgresql": - if c := r.PostgreSQL; c != nil { +func (r *Results) forDB(dbName string, newAuth bool) (*TestConfig, error) { + key := dbName + if newAuth { + key += "-newauth" + } else { + key += "-oldauth" + } + + switch key { + case "postgresql-oldauth": + if c := r.PostgreSQLOldAuth; c != nil { + return c, nil + } + case "postgresql-newauth": + if c := r.PostgreSQLNewAuth; c != nil { + return c, nil + } + case "sqlite-oldauth": + if c := r.SQLiteOldAuth; c != nil { return c, nil } - case "sqlite": - if c := r.SQLite; c != nil { + case "sqlite-newauth": + if c := r.SQLiteNewAuth; c != nil { return c, nil } case "mongodb": @@ -147,10 +164,10 @@ func (r *Results) forDB(dbName string) (*TestConfig, error) { return c, nil } default: - return nil, fmt.Errorf("unknown database %q", dbName) + return nil, fmt.Errorf("unknown database %q for newAuth=%t", dbName, newAuth) } - return nil, fmt.Errorf("no expected results for %q", dbName) + return nil, fmt.Errorf("no expected results for %q and newAuth=%t", dbName, newAuth) } // IndentedOutput returns the output of a test result with indented lines. diff --git a/internal/configload/configload.go b/internal/configload/configload.go index bf00aafd1..d73182dd2 100644 --- a/internal/configload/configload.go +++ b/internal/configload/configload.go @@ -34,10 +34,12 @@ type config struct { Results struct { // Includes is a mapping that allows us to merge sequences together, // which is currently not possible in the YAML spec - https://github.com/yaml/yaml/issues/48 - Includes map[string][]string `yaml:"includes"` - PostgreSQL *backend `yaml:"postgresql"` - SQLite *backend `yaml:"sqlite"` - MongoDB *backend `yaml:"mongodb"` + Includes map[string][]string `yaml:"includes"` + PostgreSQLOldAuth *backend `yaml:"postgresql-oldauth"` + PostgreSQLNewAuth *backend `yaml:"postgresql-newauth"` + SQLiteOldAuth *backend `yaml:"sqlite-oldauth"` + SQLiteNewAuth *backend `yaml:"sqlite-newauth"` + MongoDB *backend `yaml:"mongodb"` } `yaml:"results"` } @@ -59,14 +61,24 @@ func Load(file string) (*ic.Config, error) { return nil, fmt.Errorf("failed to decode config: %w", err) } - postgreSQL, err := cfg.Results.PostgreSQL.convert(cfg.Results.Includes) + postgreSQLOldAuth, err := cfg.Results.PostgreSQLOldAuth.convert(cfg.Results.Includes) if err != nil { - return nil, fmt.Errorf("failed to convert PostgreSQL config: %w", err) + return nil, fmt.Errorf("failed to convert PostgreSQL-oldauth config: %w", err) } - sqLite, err := cfg.Results.SQLite.convert(cfg.Results.Includes) + postgreSQLNewAuth, err := cfg.Results.PostgreSQLNewAuth.convert(cfg.Results.Includes) if err != nil { - return nil, fmt.Errorf("failed to convert SQLite config: %w", err) + return nil, fmt.Errorf("failed to convert PostgreSQL-newauth config: %w", err) + } + + sqLiteOldAuth, err := cfg.Results.SQLiteOldAuth.convert(cfg.Results.Includes) + if err != nil { + return nil, fmt.Errorf("failed to convert SQLite-oldauth config: %w", err) + } + + sqLiteNewAuth, err := cfg.Results.SQLiteNewAuth.convert(cfg.Results.Includes) + if err != nil { + return nil, fmt.Errorf("failed to convert SQLite-newauth config: %w", err) } mongoDB, err := cfg.Results.MongoDB.convert(cfg.Results.Includes) @@ -79,9 +91,11 @@ func Load(file string) (*ic.Config, error) { Dir: cfg.Dir, Args: cfg.Args, Results: ic.Results{ - PostgreSQL: postgreSQL, - SQLite: sqLite, - MongoDB: mongoDB, + PostgreSQLOldAuth: postgreSQLOldAuth, + PostgreSQLNewAuth: postgreSQLNewAuth, + SQLiteOldAuth: sqLiteOldAuth, + SQLiteNewAuth: sqLiteNewAuth, + MongoDB: mongoDB, }, }, nil } From 489f6ba7228f187cfab1614d5f5ccaf5fbd61f7a Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 10:27:37 +0100 Subject: [PATCH 04/14] handle new environment --- Taskfile.yaml | 15 +++++++-------- docker-compose.yml | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index 172b73732..a8ccb100f 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -2,7 +2,6 @@ version: "3" vars: - DB: "" TEST: "" PARALLEL: 0 @@ -42,9 +41,10 @@ tasks: --build {{.DB}} - task: init-repl - task: init-user - preconditions: - - sh: "test {{.DB}}" - msg: "Please set DB variable to one of `postgresql`, `sqlite`, or `mongodb`" + env: + FERRETDB_TEST_ENABLE_NEW_AUTH: {{.NEWAUTH}} + requires: + vars: [DB, NEWAUTH] env-pull: cmds: @@ -69,10 +69,9 @@ tasks: desc: "Run all integration tests" dir: tests cmds: - - go run ../cmd/dance -db={{.DB}} -p={{.PARALLEL}} {{.TEST}} - preconditions: - - sh: "test {{.DB}}" - msg: "Please set DB variable to one of `postgresql`, `sqlite`, or `mongodb`" + - go run ../cmd/dance -db={{.DB}} -newauth={{.NEWAUTH}} -p={{.PARALLEL}} {{.TEST}} + requires: + vars: [DB, NEWAUTH] lint: desc: "Run linters" diff --git a/docker-compose.yml b/docker-compose.yml index 5e33adfa3..a14b995fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,7 +13,7 @@ services: - FERRETDB_HANDLER=postgresql - FERRETDB_POSTGRESQL_URL=postgres://user@postgres:5432/dance - FERRETDB_REPL_SET_NAME=rs0 - - FERRETDB_TEST_ENABLE_NEW_AUTH=${NEW_AUTH:-false} + - FERRETDB_TEST_ENABLE_NEW_AUTH=${FERRETDB_TEST_ENABLE_NEW_AUTH:-false} extra_hosts: - "host.docker.internal:host-gateway" @@ -29,7 +29,7 @@ services: - FERRETDB_HANDLER=sqlite - FERRETDB_SQLITE_URL=file:/state/?_pragma=busy_timeout(20000) - FERRETDB_REPL_SET_NAME=rs0 - - FERRETDB_TEST_ENABLE_NEW_AUTH=${NEW_AUTH:-false} + - FERRETDB_TEST_ENABLE_NEW_AUTH=${FERRETDB_TEST_ENABLE_NEW_AUTH:-false} extra_hosts: - "host.docker.internal:host-gateway" From d46b6225fa1f850c1b61b2a5e9fc10a771eab372 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 10:28:19 +0100 Subject: [PATCH 05/14] fix workflow --- .github/workflows/dance.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index eae25b686..a963b8952 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -30,7 +30,7 @@ jobs: # Do not run this job in parallel for any PR change or branch push # to save some resources. concurrency: - group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} cancel-in-progress: true if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') @@ -42,6 +42,9 @@ jobs: - postgresql - sqlite - mongodb + newauth: + - false + - true test: # temporarily disabling to avoid CI noise # - dbaas_core-0 @@ -71,9 +74,6 @@ jobs: - restheart-auth - ycsb-workloada - ycsb-workloadc - auth: - - old - - new steps: - name: Checkout code @@ -96,25 +96,16 @@ jobs: run: go generate -x working-directory: tools - - name: Start environment with New Authentication - if: ${{ matrix.auth == 'new' }} + - name: Start environment env: FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main - NEW_AUTH: true - run: bin/task env-up-detach DB=${{ matrix.db }} - - - name: Start environment with Old Authentication - if: ${{ matrix.auth == 'old' }} - env: - FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main - NEW_AUTH: false - run: bin/task env-up-detach DB=${{ matrix.db }} + run: bin/task env-up-detach DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} - name: Run init run: bin/task init - name: Dance! - run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10 + run: bin/task dance DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} TEST=${{ matrix.test }} PARALLEL=10 - name: Collect logs if: failure() @@ -129,7 +120,7 @@ jobs: if: failure() uses: actions/upload-artifact@v3 with: - name: compose-logs-${{ matrix.db }}-${{ matrix.test }} + name: compose-logs-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }} path: compose-logs.zip retention-days: 3 From cc3ebc349fc02edffed045390204474eb1a50c6f Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 10:29:19 +0100 Subject: [PATCH 06/14] update files --- tests/dotnet-example-plain.sh | 5 +++++ tests/dotnet-example-plain.yml | 26 ++++++++++++++++++++++++++ tests/dotnet-example-scram.sh | 7 +++++++ tests/dotnet-example-scram.yml | 25 +++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100755 tests/dotnet-example-plain.sh create mode 100644 tests/dotnet-example-plain.yml create mode 100755 tests/dotnet-example-scram.sh create mode 100644 tests/dotnet-example-scram.yml diff --git a/tests/dotnet-example-plain.sh b/tests/dotnet-example-plain.sh new file mode 100755 index 000000000..98d6751a7 --- /dev/null +++ b/tests/dotnet-example-plain.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -ex + +dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=PLAIN' diff --git a/tests/dotnet-example-plain.yml b/tests/dotnet-example-plain.yml new file mode 100644 index 000000000..2d19cf11b --- /dev/null +++ b/tests/dotnet-example-plain.yml @@ -0,0 +1,26 @@ +--- +runner: command +dir: dotnet-example +args: ./dotnet-example-plain.sh + +results: + postgresql-oldauth: + stats: + pass: 1 + + postgresql-newauth: + stats: + pass: 1 + + sqlite-oldauth: + stats: + fail: 1 + + sqlite-newauth: + stats: + pass: 1 + + mongodb: + stats: + # PLAIN is used in MongoDB to perform LDAP authentication. + fail: 1 diff --git a/tests/dotnet-example-scram.sh b/tests/dotnet-example-scram.sh new file mode 100755 index 000000000..28f4f1612 --- /dev/null +++ b/tests/dotnet-example-scram.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +set -ex + +dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=SCRAM-SHA-1' + +dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=SCRAM-SHA-256' diff --git a/tests/dotnet-example-scram.yml b/tests/dotnet-example-scram.yml new file mode 100644 index 000000000..49a69d931 --- /dev/null +++ b/tests/dotnet-example-scram.yml @@ -0,0 +1,25 @@ +--- +runner: command +args: ./dotnet-example-scram.sh + +results: + postgresql-oldauth: + stats: + fail: 1 + + postgresql-newauth: + stats: + pass: 1 + + sqlite-oldauth: + stats: + fail: 1 + + sqlite-newauth: + stats: + pass: 1 + + mongodb: + stats: + pass: 1 + \ No newline at end of file From 5c882fb43dc81664a3773670ade0a91662180870 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:29:49 +0100 Subject: [PATCH 07/14] fix env --- Taskfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Taskfile.yaml b/Taskfile.yaml index a8ccb100f..4685370d7 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -42,7 +42,7 @@ tasks: - task: init-repl - task: init-user env: - FERRETDB_TEST_ENABLE_NEW_AUTH: {{.NEWAUTH}} + FERRETDB_TEST_ENABLE_NEW_AUTH: '{{.NEWAUTH}}' requires: vars: [DB, NEWAUTH] From ee9cc54c29fe845d53e22c87538abaa6352eb46b Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:50:46 +0100 Subject: [PATCH 08/14] undo --- ...ample-plain.yml => dotnet-example-auth.yml | 0 tests/dotnet-example-plain.sh | 5 ---- tests/dotnet-example-scram.sh | 7 ------ tests/dotnet-example-scram.yml | 25 ------------------- 4 files changed, 37 deletions(-) rename tests/dotnet-example-plain.yml => dotnet-example-auth.yml (100%) delete mode 100755 tests/dotnet-example-plain.sh delete mode 100755 tests/dotnet-example-scram.sh delete mode 100644 tests/dotnet-example-scram.yml diff --git a/tests/dotnet-example-plain.yml b/dotnet-example-auth.yml similarity index 100% rename from tests/dotnet-example-plain.yml rename to dotnet-example-auth.yml diff --git a/tests/dotnet-example-plain.sh b/tests/dotnet-example-plain.sh deleted file mode 100755 index 98d6751a7..000000000 --- a/tests/dotnet-example-plain.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -ex - -dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=PLAIN' diff --git a/tests/dotnet-example-scram.sh b/tests/dotnet-example-scram.sh deleted file mode 100755 index 28f4f1612..000000000 --- a/tests/dotnet-example-scram.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -ex - -dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=SCRAM-SHA-1' - -dotnet run 'mongodb://user:password@localhost:27017/?replicaSet=rs0&authMechanism=SCRAM-SHA-256' diff --git a/tests/dotnet-example-scram.yml b/tests/dotnet-example-scram.yml deleted file mode 100644 index 49a69d931..000000000 --- a/tests/dotnet-example-scram.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -runner: command -args: ./dotnet-example-scram.sh - -results: - postgresql-oldauth: - stats: - fail: 1 - - postgresql-newauth: - stats: - pass: 1 - - sqlite-oldauth: - stats: - fail: 1 - - sqlite-newauth: - stats: - pass: 1 - - mongodb: - stats: - pass: 1 - \ No newline at end of file From 77819e3f697eb1217b314db2c7df784e07a7db9a Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:51:02 +0100 Subject: [PATCH 09/14] rm --- dotnet-example-auth.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 dotnet-example-auth.yml diff --git a/dotnet-example-auth.yml b/dotnet-example-auth.yml deleted file mode 100644 index 2d19cf11b..000000000 --- a/dotnet-example-auth.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -runner: command -dir: dotnet-example -args: ./dotnet-example-plain.sh - -results: - postgresql-oldauth: - stats: - pass: 1 - - postgresql-newauth: - stats: - pass: 1 - - sqlite-oldauth: - stats: - fail: 1 - - sqlite-newauth: - stats: - pass: 1 - - mongodb: - stats: - # PLAIN is used in MongoDB to perform LDAP authentication. - fail: 1 From fbb5f8e35fef317a6c8a415d5299e1818842375a Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:51:22 +0100 Subject: [PATCH 10/14] add new flag --- cmd/dance/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/dance/main.go b/cmd/dance/main.go index 729c18c7b..c1a477375 100644 --- a/cmd/dance/main.go +++ b/cmd/dance/main.go @@ -71,6 +71,7 @@ func logResult(label string, res map[string]string) { func main() { dbF := flag.String("db", "", "database to use: postgresql, sqlite, mongodb") + newAuth := flag.Bool("newauth", false, "use new authentication mechanism") vF := flag.Bool("v", false, "be verbose") pF := flag.Int("p", 0, "number of tests to run in parallel") log.SetFlags(0) @@ -124,7 +125,7 @@ func main() { log.Printf("\tDir changed to %s", dir) } - expectedConfig, err := cfg.ForDB(*dbF) + expectedConfig, err := cfg.ForDB(*dbF, *newAuth) if err != nil { log.Fatal(err) } From ca2f9547be4bb56c620e82fb4c1031b532d17627 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:53:37 +0100 Subject: [PATCH 11/14] do not run on CI yet --- .github/workflows/dance.yml | 257 ++++++++++++++++++------------------ 1 file changed, 127 insertions(+), 130 deletions(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index a963b8952..f888805a9 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -1,131 +1,128 @@ --- -name: Dance -on: - pull_request: - types: - - unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild - - opened - - reopened - - synchronize - push: - branches: - - main - schedule: - - cron: "12 3 * * *" # after FerretDB's Docker workflow - -env: - GOPATH: /home/runner/go - GOCACHE: /home/runner/go/cache - GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint - GOMODCACHE: /home/runner/go/mod - GOPROXY: https://proxy.golang.org - GOTOOLCHAIN: local - -jobs: - dance: - name: dance - runs-on: ubuntu-22.04 - timeout-minutes: 45 - - # Do not run this job in parallel for any PR change or branch push - # to save some resources. - concurrency: - group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - - if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') - - strategy: - fail-fast: false - matrix: - db: - - postgresql - - sqlite - - mongodb - newauth: - - false - - true - test: - # temporarily disabling to avoid CI noise - # - dbaas_core-0 - # - dbaas_core-1 - # - dbaas_core-2 - # - dbaas_core-3 - - dotnet-example - - dotnet-example-auth - - dotnet-example-auth-scram-sha-1 - - dotnet-example-auth-scram-sha-256 - - java-example - - java-example-auth - - java-example-auth-scram-sha-1 - - java-example-auth-scram-sha-256 - - meteor-doc-fetcher - - meteor-oplog-cursor-supported - - meteor-oplog-entry-skipping - - meteor-oplog-x-implicit-collection-creation - - mongo - - mongo-go-driver - - mongo-tools - - python-example - - python-example-auth - - python-example-auth-scram-sha-1 - - python-example-auth-scram-sha-256 - - restheart - - restheart-auth - - ycsb-workloada - - ycsb-workloadc - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - - name: Setup Go - uses: FerretDB/github-actions/setup-go@main - with: - cache-key: dance - - - name: Install Java - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '17' - - - name: Install Task - run: go generate -x - working-directory: tools - - - name: Start environment - env: - FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main - run: bin/task env-up-detach DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} - - - name: Run init - run: bin/task init - - - name: Dance! - run: bin/task dance DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} TEST=${{ matrix.test }} PARALLEL=10 - - - name: Collect logs - if: failure() - run: | - bin/task env-logs-collect > /tmp/compose-logs.txt - - - name: Compress logs before upload - if: failure() - run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: compose-logs-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }} - path: compose-logs.zip - retention-days: 3 - - # ignore `go mod tidy` being applied to the Go driver, etc - - name: Check dirty - run: | - git status --ignore-submodules=none - git diff --ignore-submodules=all --exit-code + name: Dance + on: + pull_request: + types: + - unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild + - opened + - reopened + - synchronize + push: + branches: + - main + schedule: + - cron: "12 3 * * *" # after FerretDB's Docker workflow + + env: + GOPATH: /home/runner/go + GOCACHE: /home/runner/go/cache + GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint + GOMODCACHE: /home/runner/go/mod + GOPROXY: https://proxy.golang.org + GOTOOLCHAIN: local + + jobs: + dance: + name: dance + runs-on: ubuntu-22.04 + timeout-minutes: 45 + + # Do not run this job in parallel for any PR change or branch push + # to save some resources. + concurrency: + group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + + if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') + + strategy: + fail-fast: false + matrix: + db: + - postgresql + - sqlite + - mongodb + test: + # temporarily disabling to avoid CI noise + # - dbaas_core-0 + # - dbaas_core-1 + # - dbaas_core-2 + # - dbaas_core-3 + - dotnet-example + - dotnet-example-auth + - dotnet-example-auth-scram-sha-1 + - dotnet-example-auth-scram-sha-256 + - java-example + - java-example-auth + - java-example-auth-scram-sha-1 + - java-example-auth-scram-sha-256 + - meteor-doc-fetcher + - meteor-oplog-cursor-supported + - meteor-oplog-entry-skipping + - meteor-oplog-x-implicit-collection-creation + - mongo + - mongo-go-driver + - mongo-tools + - python-example + - python-example-auth + - python-example-auth-scram-sha-1 + - python-example-auth-scram-sha-256 + - restheart + - restheart-auth + - ycsb-workloada + - ycsb-workloadc + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Go + uses: FerretDB/github-actions/setup-go@main + with: + cache-key: dance + + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: Install Task + run: go generate -x + working-directory: tools + + - name: Start environment + run: bin/task env-up-detach DB=${{ matrix.db }} + env: + FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main + + - name: Run init + run: bin/task init + + - name: Dance! + run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10 + + - name: Collect logs + if: failure() + run: | + bin/task env-logs-collect > /tmp/compose-logs.txt + + - name: Compress logs before upload + if: failure() + run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: compose-logs-${{ matrix.db }}-${{ matrix.test }} + path: compose-logs.zip + retention-days: 3 + + # ignore `go mod tidy` being applied to the Go driver, etc + - name: Check dirty + run: | + git status --ignore-submodules=none + git diff --ignore-submodules=all --exit-code From 1203cc25be6432e13fc62a7297cccae510dab565 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:55:43 +0100 Subject: [PATCH 12/14] fix --- .github/workflows/dance.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index f888805a9..1b4ff5386 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -48,6 +48,7 @@ # - dbaas_core-1 # - dbaas_core-2 # - dbaas_core-3 + # - diff - dotnet-example - dotnet-example-auth - dotnet-example-auth-scram-sha-1 From 7da435e3b2b483e8a2cde8e6856cb2302e44f094 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 11:57:02 +0100 Subject: [PATCH 13/14] indentation --- .github/workflows/dance.yml | 256 ++++++++++++++++++------------------ 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index 1b4ff5386..efa8f3619 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -1,129 +1,129 @@ --- - name: Dance - on: - pull_request: - types: - - unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild - - opened - - reopened - - synchronize - push: - branches: - - main - schedule: - - cron: "12 3 * * *" # after FerretDB's Docker workflow - - env: - GOPATH: /home/runner/go - GOCACHE: /home/runner/go/cache - GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint - GOMODCACHE: /home/runner/go/mod - GOPROXY: https://proxy.golang.org - GOTOOLCHAIN: local - - jobs: - dance: - name: dance - runs-on: ubuntu-22.04 - timeout-minutes: 45 - - # Do not run this job in parallel for any PR change or branch push - # to save some resources. - concurrency: - group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true - - if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') - - strategy: - fail-fast: false - matrix: - db: - - postgresql - - sqlite - - mongodb - test: - # temporarily disabling to avoid CI noise - # - dbaas_core-0 - # - dbaas_core-1 - # - dbaas_core-2 - # - dbaas_core-3 - # - diff - - dotnet-example - - dotnet-example-auth - - dotnet-example-auth-scram-sha-1 - - dotnet-example-auth-scram-sha-256 - - java-example - - java-example-auth - - java-example-auth-scram-sha-1 - - java-example-auth-scram-sha-256 - - meteor-doc-fetcher - - meteor-oplog-cursor-supported - - meteor-oplog-entry-skipping - - meteor-oplog-x-implicit-collection-creation - - mongo - - mongo-go-driver - - mongo-tools - - python-example - - python-example-auth - - python-example-auth-scram-sha-1 - - python-example-auth-scram-sha-256 - - restheart - - restheart-auth - - ycsb-workloada - - ycsb-workloadc - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - submodules: true - - - name: Setup Go - uses: FerretDB/github-actions/setup-go@main - with: - cache-key: dance - - - name: Install Java - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '17' - - - name: Install Task - run: go generate -x - working-directory: tools - - - name: Start environment - run: bin/task env-up-detach DB=${{ matrix.db }} - env: - FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main - - - name: Run init - run: bin/task init - - - name: Dance! - run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10 - - - name: Collect logs - if: failure() - run: | - bin/task env-logs-collect > /tmp/compose-logs.txt - - - name: Compress logs before upload - if: failure() - run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt - - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v3 - with: - name: compose-logs-${{ matrix.db }}-${{ matrix.test }} - path: compose-logs.zip - retention-days: 3 - - # ignore `go mod tidy` being applied to the Go driver, etc - - name: Check dirty - run: | - git status --ignore-submodules=none - git diff --ignore-submodules=all --exit-code +name: Dance +on: + pull_request: + types: + - unlabeled # if GitHub Actions stuck, add and remove "not ready" label to force rebuild + - opened + - reopened + - synchronize + push: + branches: + - main + schedule: + - cron: "12 3 * * *" # after FerretDB's Docker workflow + +env: + GOPATH: /home/runner/go + GOCACHE: /home/runner/go/cache + GOLANGCI_LINT_CACHE: /home/runner/go/cache/lint + GOMODCACHE: /home/runner/go/mod + GOPROXY: https://proxy.golang.org + GOTOOLCHAIN: local + +jobs: + dance: + name: dance + runs-on: ubuntu-22.04 + timeout-minutes: 45 + + # Do not run this job in parallel for any PR change or branch push + # to save some resources. + concurrency: + group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} + cancel-in-progress: true + + if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') + + strategy: + fail-fast: false + matrix: + db: + - postgresql + - sqlite + - mongodb + test: + # temporarily disabling to avoid CI noise + # - dbaas_core-0 + # - dbaas_core-1 + # - dbaas_core-2 + # - dbaas_core-3 + # - diff + - dotnet-example + - dotnet-example-auth + - dotnet-example-auth-scram-sha-1 + - dotnet-example-auth-scram-sha-256 + - java-example + - java-example-auth + - java-example-auth-scram-sha-1 + - java-example-auth-scram-sha-256 + - meteor-doc-fetcher + - meteor-oplog-cursor-supported + - meteor-oplog-entry-skipping + - meteor-oplog-x-implicit-collection-creation + - mongo + - mongo-go-driver + - mongo-tools + - python-example + - python-example-auth + - python-example-auth-scram-sha-1 + - python-example-auth-scram-sha-256 + - restheart + - restheart-auth + - ycsb-workloada + - ycsb-workloadc + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Setup Go + uses: FerretDB/github-actions/setup-go@main + with: + cache-key: dance + + - name: Install Java + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '17' + + - name: Install Task + run: go generate -x + working-directory: tools + + - name: Start environment + run: bin/task env-up-detach DB=${{ matrix.db }} + env: + FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main + + - name: Run init + run: bin/task init + + - name: Dance! + run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10 + + - name: Collect logs + if: failure() + run: | + bin/task env-logs-collect > /tmp/compose-logs.txt + + - name: Compress logs before upload + if: failure() + run: zip -q -9 compose-logs.zip /tmp/compose-logs.txt + + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v3 + with: + name: compose-logs-${{ matrix.db }}-${{ matrix.test }} + path: compose-logs.zip + retention-days: 3 + + # ignore `go mod tidy` being applied to the Go driver, etc + - name: Check dirty + run: | + git status --ignore-submodules=none + git diff --ignore-submodules=all --exit-code From 04eb478ef978fef61a3a8d2b67e1520bf8f250b9 Mon Sep 17 00:00:00 2001 From: b1ron Date: Tue, 20 Feb 2024 12:10:34 +0100 Subject: [PATCH 14/14] fix workflow file --- .github/workflows/dance.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dance.yml b/.github/workflows/dance.yml index efa8f3619..c5a43108e 100644 --- a/.github/workflows/dance.yml +++ b/.github/workflows/dance.yml @@ -30,7 +30,7 @@ jobs: # Do not run this job in parallel for any PR change or branch push # to save some resources. concurrency: - group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} + group: ${{ github.workflow }}-dance-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }}-${{ github.head_ref || github.ref_name }} cancel-in-progress: true if: github.event_name != 'pull_request' || !contains(github.event.pull_request.labels.*.name, 'not ready') @@ -48,7 +48,6 @@ jobs: # - dbaas_core-1 # - dbaas_core-2 # - dbaas_core-3 - # - diff - dotnet-example - dotnet-example-auth - dotnet-example-auth-scram-sha-1 @@ -72,6 +71,9 @@ jobs: - restheart-auth - ycsb-workloada - ycsb-workloadc + newauth: + - false + - true steps: - name: Checkout code @@ -95,15 +97,15 @@ jobs: working-directory: tools - name: Start environment - run: bin/task env-up-detach DB=${{ matrix.db }} env: FERRETDB_IMAGE: ghcr.io/ferretdb/ferretdb-dev:main + run: bin/task env-up-detach DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} - name: Run init run: bin/task init - name: Dance! - run: bin/task dance DB=${{ matrix.db }} TEST=${{ matrix.test }} PARALLEL=10 + run: bin/task dance DB=${{ matrix.db }} NEWAUTH=${{ matrix.newauth }} TEST=${{ matrix.test }} PARALLEL=10 - name: Collect logs if: failure() @@ -118,7 +120,7 @@ jobs: if: failure() uses: actions/upload-artifact@v3 with: - name: compose-logs-${{ matrix.db }}-${{ matrix.test }} + name: compose-logs-${{ matrix.db }}-${{ matrix.newauth }}-${{ matrix.test }} path: compose-logs.zip retention-days: 3