Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: split unit tests #3492

Merged
merged 2 commits into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 29 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
jobs:
integration:
name: Integrations
name: Integration
runs-on: 'ubuntu-20.04'
strategy:
matrix:
Expand All @@ -23,20 +23,19 @@ jobs:
- run: go version
- run: go mod download # Not required, used to segregate module download vs test times

- name: Integration test for enterprise
- name: enterprise
if: matrix.FEATURES == 'enterprise'
run: go test -v ./integration_test/docker_test/docker_test.go -count 1
env:
ENTERPRISE_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}

- name: Integration test for oss
- name: oss
if: matrix.FEATURES == 'oss'
run: go test -v ./integration_test/docker_test/docker_test.go -count 1
env:
RSERVER_ENABLE_MULTITENANCY: ${{ matrix.MULTITENANCY }}

warehouse-integration:
name: Warehouse Service Integration
name: Warehouse Integration
runs-on: 'ubuntu-20.04'
strategy:
fail-fast: false
Expand Down Expand Up @@ -99,7 +98,6 @@ jobs:
with:
name: ${{ matrix.destination }}
path: coverage.txt

unit:
name: Unit
runs-on: 'ubuntu-20.04'
Expand All @@ -109,26 +107,21 @@ jobs:
with:
go-version: '~1.20.4'
check-latest: true

- run: go version
- run: go mod download # Not required, used to segregate module download vs test times
- env:
TEST_KAFKA_CONFLUENT_CLOUD_HOST: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_HOST }}
TEST_KAFKA_CONFLUENT_CLOUD_KEY: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_KEY }}
TEST_KAFKA_CONFLUENT_CLOUD_SECRET: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_SECRET }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING }}
run: make test exclude=/rudder-server/warehouse
- run: make test exclude="/rudder-server/(jobsdb|integration_test|processor|regulation-worker|router|services|suppression-backup-service|warehouse)"
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: unit
path: coverage.txt

warehouse-unit:
name: Warehouse Unit
package-unit:
name: Package Unit
runs-on: 'ubuntu-20.04'
strategy:
fail-fast: false
matrix:
package: [ jobsdb, integration_test, processor, regulation-worker, router, services, suppression-backup-service, warehouse ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
Expand All @@ -137,19 +130,29 @@ jobs:
check-latest: true
- run: go version
- run: go mod download
- env:
- name: Package Unit [ ${{ matrix.package }} ]
env:
TEST_KAFKA_CONFLUENT_CLOUD_HOST: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_HOST }}
TEST_KAFKA_CONFLUENT_CLOUD_KEY: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_KEY }}
TEST_KAFKA_CONFLUENT_CLOUD_SECRET: ${{ secrets.TEST_KAFKA_CONFLUENT_CLOUD_SECRET }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_HOST }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_EVENTHUB_NAME }}
TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING: ${{ secrets.TEST_KAFKA_AZURE_EVENT_HUBS_CLOUD_CONNECTION_STRING }}
TEST_S3_DATALAKE_CREDENTIALS: ${{ secrets.TEST_S3_DATALAKE_CREDENTIALS }}
BIGQUERY_INTEGRATION_TEST_CREDENTIALS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDENTIALS }}
run: make test package=./warehouse/...
run: make test package=./${{ matrix.package }}/...
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: warehouse-unit
name: ${{ matrix.package }}-unit
path: coverage.txt

coverage:
needs: [warehouse-integration, unit, warehouse-unit]
name: Coverage
runs-on: 'ubuntu-20.04'
needs:
- warehouse-integration
- unit
- package-unit
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -168,15 +171,15 @@ jobs:
with:
fail_ci_if_error: true
files: ./coverage.txt

all-tests-successful:
all-green:
name: All
if: always()
runs-on: ubuntu-latest
needs:
- integration
- warehouse-integration
- unit
- warehouse-unit
- package-unit
steps:
- uses: re-actors/alls-green@v1.2.2
with:
Expand Down