Skip to content

Commit b9a13e4

Browse files
fix: move enable_persistence_tests to Redis contract test jobs
Removed enable_persistence_tests and use_redis from server.yml contract tests (which have no Redis service). Added dedicated contract-tests and contract-tests-curl jobs to server-redis.yml with a Redis service container and enable_persistence_tests: true. Co-Authored-By: rlamb@launchdarkly.com <kingdewman@gmail.com>
1 parent d09ca12 commit b9a13e4

2 files changed

Lines changed: 55 additions & 4 deletions

File tree

.github/workflows/server-redis.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,61 @@ on:
1414
- cron: '0 8 * * *'
1515

1616
jobs:
17+
contract-tests:
18+
runs-on: ubuntu-22.04
19+
services:
20+
redis:
21+
image: redis
22+
ports:
23+
- 6379:6379
24+
env:
25+
TEST_SERVICE_PORT: 8123
26+
TEST_SERVICE_BINARY: ./build/contract-tests/server-contract-tests/server-tests
27+
steps:
28+
# https://github.com/actions/checkout/releases/tag/v4.3.0
29+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
30+
- uses: ./.github/actions/ci
31+
with:
32+
cmake_target: server-tests
33+
run_tests: false
34+
use_redis: true
35+
- name: 'Launch test service as background task'
36+
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
37+
# https://github.com/launchdarkly/gh-actions/releases/tag/contract-tests-v1.1.0
38+
- uses: launchdarkly/gh-actions/actions/contract-tests@2715574e04448246bc529a23a81766491bbc4aae
39+
with:
40+
test_service_port: ${{ env.TEST_SERVICE_PORT }}
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
enable_persistence_tests: true
43+
44+
contract-tests-curl:
45+
runs-on: ubuntu-22.04
46+
services:
47+
redis:
48+
image: redis
49+
ports:
50+
- 6379:6379
51+
env:
52+
TEST_SERVICE_PORT: 8123
53+
TEST_SERVICE_BINARY: ./build/contract-tests/server-contract-tests/server-tests
54+
steps:
55+
# https://github.com/actions/checkout/releases/tag/v4.3.0
56+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
57+
- uses: ./.github/actions/ci
58+
with:
59+
cmake_target: server-tests
60+
run_tests: false
61+
use_curl: true
62+
use_redis: true
63+
- name: 'Launch test service as background task'
64+
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
65+
# https://github.com/launchdarkly/gh-actions/releases/tag/contract-tests-v1.1.0
66+
- uses: launchdarkly/gh-actions/actions/contract-tests@2715574e04448246bc529a23a81766491bbc4aae
67+
with:
68+
test_service_port: ${{ env.TEST_SERVICE_PORT }}
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
enable_persistence_tests: true
71+
1772
build-test-redis:
1873
runs-on: ubuntu-22.04
1974
services:

.github/workflows/server.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
with:
2828
cmake_target: server-tests
2929
run_tests: false
30-
use_redis: true
3130
- name: 'Launch test service as background task'
3231
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
3332
# https://github.com/launchdarkly/gh-actions/releases/tag/contract-tests-v1.1.0
@@ -36,7 +35,6 @@ jobs:
3635
# Inform the test harness of test service's port.
3736
test_service_port: ${{ env.TEST_SERVICE_PORT }}
3837
token: ${{ secrets.GITHUB_TOKEN }}
39-
enable_persistence_tests: true
4038

4139
contract-tests-curl:
4240
runs-on: ubuntu-22.04
@@ -52,7 +50,6 @@ jobs:
5250
cmake_target: server-tests
5351
run_tests: false
5452
use_curl: true
55-
use_redis: true
5653
- name: 'Launch test service as background task'
5754
run: $TEST_SERVICE_BINARY $TEST_SERVICE_PORT 2>&1 &
5855
# https://github.com/launchdarkly/gh-actions/releases/tag/contract-tests-v1.1.0
@@ -61,7 +58,6 @@ jobs:
6158
# Inform the test harness of test service's port.
6259
test_service_port: ${{ env.TEST_SERVICE_PORT }}
6360
token: ${{ secrets.GITHUB_TOKEN }}
64-
enable_persistence_tests: true
6561

6662
build-test-server:
6763
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)