Skip to content

Commit

Permalink
WIP initial fan out for nodejs tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rquitales committed Jan 10, 2024
1 parent 8f44f6d commit d0c9f3e
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/run-acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- master
- main
- v4
- rquitales/test-fan-out
paths-ignore:
- CHANGELOG.md
workflow_dispatch: {}
Expand Down Expand Up @@ -48,6 +49,23 @@ env:
GOOGLE_PROJECT_NUMBER: 637339343727
PR_COMMIT_SHA: ${{ github.event.client_payload.pull_request.head.sha }}
jobs:
generate-test-names:
runs-on: ubuntu-latest
name: generate-test-names
outputs:
test-names: ${{ steps.generate.outputs.test-names }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
lfs: true
ref: ${{ env.PR_COMMIT_SHA }}
- name: Generate test names
id: generate
run: |
TEST_NAMES=$(cd tests/sdk/nodejs && grep -r -h -o -E 'func Test[A-Z][a-zA-Z0-9_]+' | sort | uniq | sed 's/func //g')
TEST_NAMES_JSON=$(printf '%s\n' "${TEST_NAMES[@]}" | jq -R . | jq -s .)
echo "::set-output name=test-names::$TEST_NAMES_JSON"
comment-notification:
runs-on: ubuntu-latest
name: comment-notification
Expand Down Expand Up @@ -249,17 +267,13 @@ jobs:
test:
runs-on: pulumi-ubuntu-8core
needs:
- generate-test-names
- build_sdks
- build-test-cluster
strategy:
fail-fast: true
matrix:
language:
- nodejs
- python
- dotnet
- go
- java
test-name: ${{ fromJson(needs.generate-test-names.outputs.test-names) }}
name: test
permissions:
contents: read
Expand Down Expand Up @@ -324,11 +338,11 @@ jobs:
- name: Download SDK
uses: actions/download-artifact@v2
with:
name: ${{ matrix.language }}-sdk.tar.gz
path: ${{ github.workspace}}/sdk/
name: nodejs-sdk.tar.gz
path: nodejs/sdk/
- name: UnTar SDK folder
run: tar -zxf ${{ github.workspace}}/sdk/${{ matrix.language}}.tar.gz -C ${{
github.workspace}}/sdk/${{ matrix.language}}
run: tar -zxf ${{ github.workspace}}/sdk/nodejs.tar.gz -C ${{
github.workspace}}/sdk/nodejs
- name: Update path
run: echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: Install Node dependencies
Expand All @@ -339,7 +353,7 @@ jobs:
pip3 install virtualenv==20.0.23
pip3 install pipenv
- name: Install dependencies
run: make install_${{ matrix.language}}_sdk
run: make install_nodejs_sdk
- name: Make Kube Directory
run: mkdir -p "~/.kube/"
- name: Download Kubeconfig
Expand Down Expand Up @@ -390,7 +404,7 @@ jobs:
version: v2.4.0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: cd tests/sdk/${{ matrix.language }} && go test -v -count=1 -cover -timeout
run: cd tests/sdk/nodejs && go test -v -count=1 -cover -timeout -run ^${{ matrix.test-name}}$
2h -parallel 4 ./...
- if: failure() && github.event_name == 'push'
name: Notify Slack
Expand Down

0 comments on commit d0c9f3e

Please sign in to comment.