Skip to content

Commit

Permalink
chore: split unit tests (#3416)
Browse files Browse the repository at this point in the history
  • Loading branch information
achettyiitr authored May 29, 2023
1 parent 0bda13f commit 471a562
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,36 @@ jobs:
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
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: unit
path: coverage.txt

warehouse-unit:
name: Warehouse Unit
runs-on: 'ubuntu-20.04'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '~1.20.3'
check-latest: true
- run: go version
- run: go mod download
- env:
TEST_S3_DATALAKE_CREDENTIALS: ${{ secrets.TEST_S3_DATALAKE_CREDENTIALS }}
BIGQUERY_INTEGRATION_TEST_CREDENTIALS: ${{ secrets.BIGQUERY_INTEGRATION_TEST_CREDENTIALS }}
run: make test
run: make test package=./warehouse/...
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: unit
name: warehouse-unit
path: coverage.txt

coverage:
needs: [warehouse-integration, unit]
needs: [warehouse-integration, unit, warehouse-unit]
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout
Expand Down Expand Up @@ -157,6 +176,7 @@ jobs:
- integration
- warehouse-integration
- unit
- warehouse-unit
steps:
- uses: re-actors/alls-green@v1.2.2
with:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ else
endif
ifdef package
$(TEST_CMD) $(TEST_OPTIONS) $(package) && touch $(TESTFILE) || true
else ifdef exclude
$(eval FILES = `go list ./... | egrep -iv '$(exclude)'`)
$(TEST_CMD) -count=1 $(TEST_OPTIONS) $(FILES) && touch $(TESTFILE) || true
else
$(TEST_CMD) -count=1 $(TEST_OPTIONS) ./... && touch $(TESTFILE) || true
endif
Expand Down

0 comments on commit 471a562

Please sign in to comment.