Skip to content

Commit bf2313c

Browse files
authored
Merge pull request #372 from Data-Simply/feature/parameterize-integration-tests
feat: parameterize the integration test cases to reduce the redundancy
2 parents 7dfa902 + ca29ace commit bf2313c

44 files changed

Lines changed: 521 additions & 932 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bigquery-integration.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,8 @@ jobs:
6060
TEST_SUITE: ${{ inputs.test_suite }}
6161
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
6262
run: |
63-
uv run pytest tests/integration/bigquery -v \
64-
$(if [ "$TEST_SUITE" != "all" ]; then echo "-k $TEST_SUITE"; fi)
63+
if [ "$TEST_SUITE" == "all" ]; then
64+
uv run pytest tests/integration -k "bigquery" -v
65+
else
66+
uv run pytest tests/integration -k "bigquery and $TEST_SUITE" -v
67+
fi

.github/workflows/pyspark-integration.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,26 @@ jobs:
3838
- name: Checkout
3939
uses: actions/checkout@v4
4040

41-
- name: Setup Docker Buildx
42-
uses: docker/setup-buildx-action@v3
41+
- name: Setup Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.11"
4345

44-
- name: Build PySpark Test Image
46+
- name: Install uv Package
4547
run: |
46-
docker build -f tests/integration/pyspark/Dockerfile -t pyspark-it .
48+
pip install --upgrade pip
49+
pip install uv==0.5.30
50+
51+
- name: Install Dependencies
52+
run: |
53+
uv sync
4754
4855
- name: Run Integration Tests
4956
env:
5057
TEST_SUITE: ${{ inputs.test_suite }}
5158
run: |
5259
if [ "$TEST_SUITE" == "all" ]; then
53-
docker run --rm pyspark-it
60+
uv run pytest tests/integration -k "pyspark" -v
5461
else
55-
docker run --rm pyspark-it uv run pytest -v tests/integration/pyspark/test_${TEST_SUITE}.py
62+
uv run pytest tests/integration -k "pyspark and $TEST_SUITE" -v
5663
fi

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
env:
6464
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
6565
run: |
66-
uv run pytest tests/integration/bigquery -v
66+
uv run pytest tests/integration -k "bigquery" -v
6767
6868
pyspark-integration-tests:
6969
name: PySpark Integration Tests
@@ -78,7 +78,7 @@ jobs:
7878
docker build -f tests/integration/pyspark/Dockerfile -t pyspark-it .
7979
- name: Run PySpark Integration Tests
8080
run: |
81-
docker run --rm pyspark-it
81+
docker run --rm pyspark-it uv run pytest tests/integration -k "pyspark" -v
8282
8383
build:
8484
name: Build

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ The PySpark integration tests run in a Docker container with a pre-configured Sp
246246
# Build the PySpark test image
247247
docker build -f tests/integration/pyspark/Dockerfile -t pyspark-it .
248248

249-
# Run the integration tests
250-
docker run --rm pyspark-it uv run pytest -v tests/integration/pyspark/test_segstats_segmentation.py
249+
# Run all PySpark tests
250+
docker run --rm pyspark-it uv run pytest tests/integration -k "pyspark" -v
251251
```
252252

253253
#### BigQuery Integration Tests
@@ -271,8 +271,8 @@ export GCP_PROJECT_ID=your-project-id
271271
# Install dependencies
272272
uv sync
273273

274-
# Run all tests
275-
uv run pytest tests/integration/bigquery -v
274+
# Run all BigQuery tests
275+
uv run pytest tests/integration -k "bigquery" -v
276276

277277
# Run specific test module
278278
uv run pytest tests/integration/bigquery/test_cohort_analysis.py -v

tests/integration/bigquery/conftest.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/integration/bigquery/test_cohort_analysis.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/integration/bigquery/test_composite_rank.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

tests/integration/bigquery/test_cross_shop.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

tests/integration/bigquery/test_customer_decision_hierarchy.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

tests/integration/bigquery/test_date.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)