Skip to content

Commit 823d276

Browse files
authored
ci: separating args for v3 from v2 contract tests (#139)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > CI/Makefile wiring change only; main risk is misconfigured parameters causing contract tests to run with missing/incorrect flags. > > **Overview** > Splits contract-test harness CLI arguments into **separate v2 and v3 inputs/vars** so v3-only flags don’t get passed to v2. > > Updates the composite `contract-tests` GitHub Action and `lib/sdk/server/Makefile` to use `TEST_HARNESS_PARAMS_V2` and `TEST_HARNESS_PARAMS_V3`, and adjusts the nightly workflow to pass the long-running flag only to v3. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8fdee1d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 7271ae2 commit 823d276

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

.github/actions/contract-tests/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ inputs:
88
description: 'Github token, used for contract tests'
99
required: false
1010
default: ''
11-
test_harness_params:
12-
description: 'Optional extra parameters for the SDK test harness (e.g. -enable-long-running-tests). Passed as TEST_HARNESS_PARAMS to make.'
11+
test_harness_params_v2:
12+
description: 'Optional extra parameters for the SDK test harness v2. Passed as TEST_HARNESS_PARAMS_V2 to make.'
13+
required: false
14+
default: ''
15+
test_harness_params_v3:
16+
description: 'Optional extra parameters for the SDK test harness v3 (e.g. -enable-long-running-tests). Passed as TEST_HARNESS_PARAMS_V3 to make.'
1317
required: false
1418
default: ''
1519

@@ -18,4 +22,4 @@ runs:
1822
steps:
1923
- name: Run contract tests
2024
shell: bash
21-
run: make contract-tests -C ${{ inputs.workspace_path }} TEST_HARNESS_PARAMS="${{ inputs.test_harness_params }}"
25+
run: make contract-tests -C ${{ inputs.workspace_path }} TEST_HARNESS_PARAMS_V2="${{ inputs.test_harness_params_v2 }}" TEST_HARNESS_PARAMS_V3="${{ inputs.test_harness_params_v3 }}"

.github/workflows/nightly-contract-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
workspace_path: 'lib/sdk/server'
3636
token: ${{ secrets.GITHUB_TOKEN }}
37-
test_harness_params: '-enable-long-running-tests'
37+
test_harness_params_v3: '-enable-long-running-tests'
3838

3939
notify-slack-on-failure:
4040
runs-on: ubuntu-latest

lib/sdk/server/Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ SUPPRESSION_FILE=contract-tests/test-suppressions.txt
1414
SUPPRESSION_FILE_FDV2=contract-tests/test-suppressions-fdv2.txt
1515

1616
# Add any extra sdk-test-harness parameters here, such as -skip for tests that are
17-
# temporarily not working.
18-
TEST_HARNESS_PARAMS=
17+
# v2 and v3 params are separated because v3 supports additional parameters that v2 does not.
18+
TEST_HARNESS_PARAMS_V2=
19+
TEST_HARNESS_PARAMS_V3=
1920

2021
build-contract-tests:
2122
@cd contract-tests && ../gradlew installDist
@@ -30,10 +31,10 @@ start-contract-test-service-bg:
3031
run-contract-tests:
3132
@echo "Running SDK contract test v2..."
3233
@curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v2/downloader/run.sh \
33-
| VERSION=v2 PARAMS="-url http://localhost:$(TEST_SERVICE_PORT) -debug -skip-from=$(SUPPRESSION_FILE) $(TEST_HARNESS_PARAMS)" sh
34-
@echo "Running SDK contract test v3.0.0-alpha.1..."
34+
| VERSION=v2 PARAMS="-url http://localhost:$(TEST_SERVICE_PORT) -debug -skip-from=$(SUPPRESSION_FILE) $(TEST_HARNESS_PARAMS_V2)" sh
35+
@echo "Running SDK contract test v3..."
3536
@curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/v3.0.0-alpha.3/downloader/run.sh \
36-
| VERSION=v3.0.0-alpha.3 PARAMS="-url http://localhost:$(TEST_SERVICE_PORT) -debug -stop-service-at-end -skip-from=$(SUPPRESSION_FILE_FDV2) $(TEST_HARNESS_PARAMS)" sh
37+
| VERSION=v3.0.0-alpha.3 PARAMS="-url http://localhost:$(TEST_SERVICE_PORT) -debug -stop-service-at-end -skip-from=$(SUPPRESSION_FILE_FDV2) $(TEST_HARNESS_PARAMS_V3)" sh
3738

3839
contract-tests: build-contract-tests start-contract-test-service-bg run-contract-tests
3940

0 commit comments

Comments
 (0)