Skip to content

Commit 9f9ff34

Browse files
authored
tests: Create a separate group for feature flag suites (#3911)
Take feature flag tests out of Misc and into their own new Flags group. Also move Tasks down in the `GROUPS` dict do that it's alphabetized (except for misc which is at the bottom).
1 parent fa241c3 commit 9f9ff34

File tree

3 files changed

+178
-37
lines changed

3 files changed

+178
-37
lines changed
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Do not edit this YAML file. This file is generated automatically by executing
2+
# python scripts/split_tox_gh_actions/split_tox_gh_actions.py
3+
# The template responsible for it is in
4+
# scripts/split_tox_gh_actions/templates/base.jinja
5+
name: Test Flags
6+
on:
7+
push:
8+
branches:
9+
- master
10+
- release/**
11+
- potel-base
12+
pull_request:
13+
# Cancel in progress workflows on pull_requests.
14+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
17+
cancel-in-progress: true
18+
permissions:
19+
contents: read
20+
env:
21+
BUILD_CACHE_KEY: ${{ github.sha }}
22+
CACHED_BUILD_PATHS: |
23+
${{ github.workspace }}/dist-serverless
24+
jobs:
25+
test-flags-latest:
26+
name: Flags (latest)
27+
timeout-minutes: 30
28+
runs-on: ${{ matrix.os }}
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
python-version: ["3.8","3.12","3.13"]
33+
# python3.6 reached EOL and is no longer being supported on
34+
# new versions of hosted runners on Github Actions
35+
# ubuntu-20.04 is the last version that supported python3.6
36+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
37+
os: [ubuntu-20.04]
38+
steps:
39+
- uses: actions/[email protected]
40+
- uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
allow-prereleases: true
44+
- name: Setup Test Env
45+
run: |
46+
pip install "coverage[toml]" tox
47+
- name: Erase coverage
48+
run: |
49+
coverage erase
50+
- name: Test launchdarkly latest
51+
run: |
52+
set -x # print commands that are executed
53+
./scripts/runtox.sh "py${{ matrix.python-version }}-launchdarkly-latest"
54+
- name: Test openfeature latest
55+
run: |
56+
set -x # print commands that are executed
57+
./scripts/runtox.sh "py${{ matrix.python-version }}-openfeature-latest"
58+
- name: Test unleash latest
59+
run: |
60+
set -x # print commands that are executed
61+
./scripts/runtox.sh "py${{ matrix.python-version }}-unleash-latest"
62+
- name: Generate coverage XML (Python 3.6)
63+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
64+
run: |
65+
export COVERAGE_RCFILE=.coveragerc36
66+
coverage combine .coverage-sentry-*
67+
coverage xml --ignore-errors
68+
- name: Generate coverage XML
69+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
70+
run: |
71+
coverage combine .coverage-sentry-*
72+
coverage xml
73+
- name: Upload coverage to Codecov
74+
if: ${{ !cancelled() }}
75+
uses: codecov/[email protected]
76+
with:
77+
token: ${{ secrets.CODECOV_TOKEN }}
78+
files: coverage.xml
79+
# make sure no plugins alter our coverage reports
80+
plugin: noop
81+
verbose: true
82+
- name: Upload test results to Codecov
83+
if: ${{ !cancelled() }}
84+
uses: codecov/test-results-action@v1
85+
with:
86+
token: ${{ secrets.CODECOV_TOKEN }}
87+
files: .junitxml
88+
verbose: true
89+
test-flags-pinned:
90+
name: Flags (pinned)
91+
timeout-minutes: 30
92+
runs-on: ${{ matrix.os }}
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
python-version: ["3.8","3.12","3.13"]
97+
# python3.6 reached EOL and is no longer being supported on
98+
# new versions of hosted runners on Github Actions
99+
# ubuntu-20.04 is the last version that supported python3.6
100+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
101+
os: [ubuntu-20.04]
102+
steps:
103+
- uses: actions/[email protected]
104+
- uses: actions/setup-python@v5
105+
with:
106+
python-version: ${{ matrix.python-version }}
107+
allow-prereleases: true
108+
- name: Setup Test Env
109+
run: |
110+
pip install "coverage[toml]" tox
111+
- name: Erase coverage
112+
run: |
113+
coverage erase
114+
- name: Test launchdarkly pinned
115+
run: |
116+
set -x # print commands that are executed
117+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-launchdarkly"
118+
- name: Test openfeature pinned
119+
run: |
120+
set -x # print commands that are executed
121+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openfeature"
122+
- name: Test unleash pinned
123+
run: |
124+
set -x # print commands that are executed
125+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-unleash"
126+
- name: Generate coverage XML (Python 3.6)
127+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
128+
run: |
129+
export COVERAGE_RCFILE=.coveragerc36
130+
coverage combine .coverage-sentry-*
131+
coverage xml --ignore-errors
132+
- name: Generate coverage XML
133+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
134+
run: |
135+
coverage combine .coverage-sentry-*
136+
coverage xml
137+
- name: Upload coverage to Codecov
138+
if: ${{ !cancelled() }}
139+
uses: codecov/[email protected]
140+
with:
141+
token: ${{ secrets.CODECOV_TOKEN }}
142+
files: coverage.xml
143+
# make sure no plugins alter our coverage reports
144+
plugin: noop
145+
verbose: true
146+
- name: Upload test results to Codecov
147+
if: ${{ !cancelled() }}
148+
uses: codecov/test-results-action@v1
149+
with:
150+
token: ${{ secrets.CODECOV_TOKEN }}
151+
files: .junitxml
152+
verbose: true
153+
check_required_tests:
154+
name: All pinned Flags tests passed
155+
needs: test-flags-pinned
156+
# Always run this, even if a dependent job failed
157+
if: always()
158+
runs-on: ubuntu-20.04
159+
steps:
160+
- name: Check for failures
161+
if: contains(needs.test-flags-pinned.result, 'failure') || contains(needs.test-flags-pinned.result, 'skipped')
162+
run: |
163+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

.github/workflows/test-integrations-misc.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,10 @@ jobs:
4747
- name: Erase coverage
4848
run: |
4949
coverage erase
50-
- name: Test launchdarkly latest
51-
run: |
52-
set -x # print commands that are executed
53-
./scripts/runtox.sh "py${{ matrix.python-version }}-launchdarkly-latest"
5450
- name: Test loguru latest
5551
run: |
5652
set -x # print commands that are executed
5753
./scripts/runtox.sh "py${{ matrix.python-version }}-loguru-latest"
58-
- name: Test openfeature latest
59-
run: |
60-
set -x # print commands that are executed
61-
./scripts/runtox.sh "py${{ matrix.python-version }}-openfeature-latest"
6254
- name: Test opentelemetry latest
6355
run: |
6456
set -x # print commands that are executed
@@ -79,10 +71,6 @@ jobs:
7971
run: |
8072
set -x # print commands that are executed
8173
./scripts/runtox.sh "py${{ matrix.python-version }}-typer-latest"
82-
- name: Test unleash latest
83-
run: |
84-
set -x # print commands that are executed
85-
./scripts/runtox.sh "py${{ matrix.python-version }}-unleash-latest"
8674
- name: Generate coverage XML (Python 3.6)
8775
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
8876
run: |
@@ -135,18 +123,10 @@ jobs:
135123
- name: Erase coverage
136124
run: |
137125
coverage erase
138-
- name: Test launchdarkly pinned
139-
run: |
140-
set -x # print commands that are executed
141-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-launchdarkly"
142126
- name: Test loguru pinned
143127
run: |
144128
set -x # print commands that are executed
145129
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-loguru"
146-
- name: Test openfeature pinned
147-
run: |
148-
set -x # print commands that are executed
149-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openfeature"
150130
- name: Test opentelemetry pinned
151131
run: |
152132
set -x # print commands that are executed
@@ -167,10 +147,6 @@ jobs:
167147
run: |
168148
set -x # print commands that are executed
169149
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-typer"
170-
- name: Test unleash pinned
171-
run: |
172-
set -x # print commands that are executed
173-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-unleash"
174150
- name: Generate coverage XML (Python 3.6)
175151
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
176152
run: |

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@
7676
"cloud_resource_context",
7777
"gcp",
7878
],
79-
"Tasks": [
80-
"arq",
81-
"beam",
82-
"celery",
83-
"dramatiq",
84-
"huey",
85-
"ray",
86-
"rq",
87-
"spark",
88-
],
8979
"DBs": [
9080
"asyncpg",
9181
"clickhouse_driver",
@@ -94,6 +84,11 @@
9484
"redis_py_cluster_legacy",
9585
"sqlalchemy",
9686
],
87+
"Flags": [
88+
"launchdarkly",
89+
"openfeature",
90+
"unleash",
91+
],
9792
"GraphQL": [
9893
"ariadne",
9994
"gql",
@@ -106,6 +101,16 @@
106101
"httpx",
107102
"requests",
108103
],
104+
"Tasks": [
105+
"arq",
106+
"beam",
107+
"celery",
108+
"dramatiq",
109+
"huey",
110+
"ray",
111+
"rq",
112+
"spark",
113+
],
109114
"Web 1": [
110115
"django",
111116
"flask",
@@ -125,15 +130,12 @@
125130
"tornado",
126131
],
127132
"Misc": [
128-
"launchdarkly",
129133
"loguru",
130-
"openfeature",
131134
"opentelemetry",
132135
"potel",
133136
"pure_eval",
134137
"trytond",
135138
"typer",
136-
"unleash",
137139
],
138140
}
139141

0 commit comments

Comments
 (0)