From ddf4fc09f80c68077a7fa2b900794f3203eba460 Mon Sep 17 00:00:00 2001 From: Alok Kumar Singh Date: Sat, 30 Nov 2024 00:07:58 +0530 Subject: [PATCH] Workflow and test minor changes Signed-off-by: Alok Kumar Singh --- .github/workflows/ci-e2e-cassandra.yml | 7 ++++--- pkg/cassandra/config/config_test.go | 5 +++++ pkg/cassandra/config/schema.go | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-e2e-cassandra.yml b/.github/workflows/ci-e2e-cassandra.yml index bc3392e3846..ff35450fe83 100644 --- a/.github/workflows/ci-e2e-cassandra.yml +++ b/.github/workflows/ci-e2e-cassandra.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: jaeger-version: [v1, v2] - skip-apply-schema: [true, false] + create-schema: [manual, auto] version: - distribution: cassandra major: 4.x @@ -34,7 +34,7 @@ jobs: # Exclude v1 as create schema on fly is available for v2 only - jaeger-version: v1 skip-apply-schema: true - name: ${{ matrix.version.distribution }} ${{ matrix.version.major }} ${{ matrix.jaeger-version }} ${{ matrix.skip-apply-schema == true && 'auto' || 'manual' }} + name: ${{ matrix.version.distribution }} ${{ matrix.version.major }} ${{ matrix.jaeger-version }} ${{ matrix.create-schema }} steps: - name: Harden Runner uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 @@ -51,7 +51,8 @@ jobs: id: test-execution run: bash scripts/cassandra-integration-test.sh ${{ matrix.version.major }} ${{ matrix.version.schema }} ${{ matrix.jaeger-version }} env: - CASSANDRA_CREATE_SCHEMA: ${{ matrix.skip-apply-schema }} + CASSANDRA_CREATE_SCHEMA: ${{ matrix.create-schema == 'auto' && true || false }} + SKIP_APPLY_SCHEMA: ${{ matrix.create-schema == 'auto' && true || false }} - name: Upload coverage to codecov uses: ./.github/actions/upload-codecov diff --git a/pkg/cassandra/config/config_test.go b/pkg/cassandra/config/config_test.go index 3f218592916..f1de4f6d55b 100644 --- a/pkg/cassandra/config/config_test.go +++ b/pkg/cassandra/config/config_test.go @@ -112,4 +112,9 @@ func TestConfigSchemaValidation(t *testing.T) { cfg.Schema.CompactionWindow = time.Minute - 1 err = cfg.Validate() require.Error(t, err) + + cfg.Schema.CompactionWindow = time.Minute + cfg.Schema.DependenciesTTL = time.Second - 1 + err = cfg.Validate() + require.Error(t, err) } diff --git a/pkg/cassandra/config/schema.go b/pkg/cassandra/config/schema.go index b0e69f35bc6..902667bcd36 100644 --- a/pkg/cassandra/config/schema.go +++ b/pkg/cassandra/config/schema.go @@ -95,7 +95,7 @@ func (*schemaCreator) getQueriesFromBytes(queryFile []byte) ([]string, error) { } if len(queryString) > 0 { - return nil, errors.New(`invalid template`) + return nil, errors.New(`query exists in template without ";"`) } return queries, nil