Skip to content

Commit

Permalink
setup test matrixes to parallize more jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnoble committed Jul 21, 2023
1 parent bc9e2f4 commit ee65303
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 131 deletions.
142 changes: 13 additions & 129 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
strategy:
matrix:
node-version: [14.21.3, 16.19.1, 18.16.0]
search-version: [elasticsearch6, elasticsearch7, opensearch1, opensearch2]
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -78,27 +79,16 @@ jobs:
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test elasticsearch 6
run: yarn --silent test
working-directory: ./packages/teraslice

- name: Test elasticsearch 7
run: yarn --silent test:elasticsearch7
working-directory: ./packages/teraslice

- name: Test opensearch 1.3
run: yarn --silent test:opensearch1
working-directory: ./packages/teraslice

- name: Test opensearch 2.8
run: yarn --silent test:opensearch2
- name: Test ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
working-directory: ./packages/teraslice

elasticsearch-store-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.21.3, 16.19.1, 18.16.0]
search-version: [elasticsearch6, elasticsearch7, opensearch1, opensearch2]
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -121,20 +111,8 @@ jobs:
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test elasticsearch 6
run: yarn --silent test
working-directory: ./packages/elasticsearch-store

- name: Test elasticsearch 7
run: yarn --silent test:elasticsearch7
working-directory: ./packages/elasticsearch-store

- name: Test opensearch 1.3
run: yarn --silent test:opensearch1
working-directory: ./packages/elasticsearch-store

- name: Test opensearch 2.8
run: yarn --silent test:opensearch2
- name: Test ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
working-directory: ./packages/elasticsearch-store

# This is for backwards compatability, should be removed in the future
Expand Down Expand Up @@ -171,6 +149,7 @@ jobs:
strategy:
matrix:
node-version: [14.21.3, 16.19.1, 18.16.0]
search-version: [elasticsearch6, elasticsearch7, opensearch1, opensearch2]
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -193,21 +172,10 @@ jobs:
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test elasticsearch 6
run: yarn --silent test
working-directory: ./packages/elasticsearch-api

- name: Test elasticsearch 7
run: yarn --silent test:7
- name: Test ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
working-directory: ./packages/elasticsearch-api

- name: Test opensearch
run: yarn --silent test:opensearch1
working-directory: ./packages/elasticsearch-api

- name: Test opensearch 2
run: yarn --silent test:opensearch2
working-directory: ./packages/elasticsearch-api

# This is for backwards compatability, should be removed in the future
elasticsearch-api-legacy:
Expand Down Expand Up @@ -238,11 +206,12 @@ jobs:
run: yarn --silent test:legacy
working-directory: ./packages/elasticsearch-api

e2e-tests-multi-node-elasticsearch6:
e2e-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.21.3, 16.19.1, 18.16.0]
search-version: [elasticsearch6, elasticsearch7, opensearch1, opensearch2]
steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -265,91 +234,6 @@ jobs:
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test
run: yarn --silent test
working-directory: ./e2e


e2e-tests-node18-opensearch2:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup Node 18.16.0
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'yarn'

# we login to docker to avoid docker pull limit rates
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Install and build packages
run: yarn setup
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test Opensearch 2
run: yarn --silent test:opensearch2
working-directory: ./e2e

e2e-tests-node18-opensearch1:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup Node 18.16.0
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'yarn'

# we login to docker to avoid docker pull limit rates
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Install and build packages
run: yarn setup
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test Opensearch 2
run: yarn --silent test:opensearch1
working-directory: ./e2e

e2e-tests-node18-elasticsearch7:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup Node 18.16.0
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'yarn'

# we login to docker to avoid docker pull limit rates
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Install and build packages
run: yarn setup
env:
YARN_SETUP_ARGS: "--prod=false --silent"

- name: Test Opensearch 2
run: yarn --silent test:elasticsearch7
- name: Test ${{ matrix.search-version }}
run: yarn --silent test:${{ matrix.search-version }}
working-directory: ./e2e
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"setup": "yarn --silent",
"test": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:debug": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --debug --",
"test:elasticsearch6": "TEST_ELASTICSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:elasticsearch7": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:opensearch1": "TEST_OPENSEARCH='true' TEST_KAFKA='true' ts-scripts test --suite e2e --",
"test:opensearch2": "TEST_OPENSEARCH='true' OPENSEARCH_VERSION='2.8.0' TEST_KAFKA='true' ts-scripts test --suite e2e --",
Expand Down
5 changes: 3 additions & 2 deletions packages/elasticsearch-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
"typings": "types/index.d.ts",
"scripts": {
"test": "TEST_RESTRAINED_ELASTICSEARCH='true' ts-scripts test . --",
"test:7": "TEST_RESTRAINED_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
"test:8": "TEST_RESTRAINED_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='8.1.2' ts-scripts test . --",
"test:elasticsearch6": "TEST_RESTRAINED_ELASTICSEARCH='true' ts-scripts test . --",
"test:elasticsearch7": "TEST_RESTRAINED_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
"test:elasticsearch8": "TEST_RESTRAINED_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='8.1.2' ts-scripts test . --",
"test:debug": "TEST_RESTRAINED_ELASTICSEARCH='true' ts-scripts test --debug . --",
"test:legacy": "TEST_RESTRAINED_ELASTICSEARCH='true' LEGACY_CLIENT=true ts-scripts test . --",
"test:opensearch1": "TEST_RESTRAINED_OPENSEARCH='true' ts-scripts test --debug . --",
Expand Down
1 change: 1 addition & 0 deletions packages/elasticsearch-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"build:watch": "yarn build --watch",
"test": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
"test:debug": "TEST_ELASTICSEARCH='true' ts-scripts test --debug . --",
"test:elasticsearch6": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
"test:elasticsearch7": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
"test:elasticsearch8": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='8.1.2' ts-scripts test . --",
"test:legacy": "TEST_ELASTICSEARCH='true' LEGACY_CLIENT=true ts-scripts test . --",
Expand Down
1 change: 1 addition & 0 deletions packages/teraslice/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"start": "node service.js",
"test": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
"test:debug": "TEST_ELASTICSEARCH='true' ts-scripts test --debug . --",
"test:elasticsearch6": "TEST_ELASTICSEARCH='true' ts-scripts test . --",
"test:elasticsearch7": "TEST_ELASTICSEARCH='true' ELASTICSEARCH_VERSION='7.9.3' ts-scripts test . --",
"test:opensearch1": "TEST_OPENSEARCH='true' ts-scripts test . --",
"test:opensearch2": "TEST_OPENSEARCH='true' OPENSEARCH_VERSION='2.8.0' ts-scripts test . --",
Expand Down

0 comments on commit ee65303

Please sign in to comment.