Skip to content

Commit

Permalink
shard target
Browse files Browse the repository at this point in the history
  • Loading branch information
blampe committed Nov 15, 2024
1 parent 203ddbc commit 47c86a8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,13 @@ jobs:
- name: Install dependencies
run: make install_sdks

# TODO: This should be a make target.
- name: Generate shard
id: shard
uses: hashicorp-forge/go-test-split-action@v2.0.0
with:
working-directory: examples # TODO: Parameterize this.
flags: -tags=all
total: ${{ matrix.total }}
index: ${{ matrix.index }}
run: make shard >> "$GITHUB_ENV"
env:
TOTAL: ${{ matrix.total }}
INDEX: ${{ matrix.index }}
- name: Run example tests
run: make test_shard
env:
TAGS: all
TESTS: ${{ steps.shard.outputs.run}}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,14 @@ test_provider:
.pulumi/version: nodejs/eks/yarn.lock
(cd nodejs/eks && yarn list --pattern @pulumi/pulumi --json --no-progress | jq -r '.data.trees[].name' | cut -d'@' -f3 > ../../.pulumi/version)


shard:
cd tests && \
go run github.com/blampe/shard@output --total $(TOTAL) --index $(INDEX) --output env

test_shard:
cd tests && \
go test -tags=$(TAGS) -v -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 3h -parallel ${TESTPARALLELISM} -run "${TESTS}" ./...
go test -tags=all -v -count=1 -coverprofile="coverage.txt" -coverpkg=./... -timeout 3h -parallel ${TESTPARALLELISM} -run "$(SHARD_TESTS)" $(SHARD_PATHS)

install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi
install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH)
Expand Down

0 comments on commit 47c86a8

Please sign in to comment.