Skip to content

Commit

Permalink
separate integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Aug 6, 2023
1 parent feb2a9c commit 299401c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ jobs:

strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x, 20.x]
adapter: [Fake, Redis, Redis-Cluster, AMQP, NATS, Kafka]
fail-fast: false
steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }} with ${{ matrix.adapter }} adaoter
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
Expand All @@ -54,8 +55,29 @@ jobs:
#- name: Run unit tests
# run: npm run test:unit

- name: Start containers
run: docker-compose up -d
- name: Start containers for Redis adapter
if: ${{ matrix.adapter == 'Redis' }}
run: docker-compose up -d redis
working-directory: ./test

- name: Start containers for Redis cluster adapter
if: ${{ matrix.adapter == 'Redis-Cluster' }}
run: docker-compose up -d redis-node1 redis-node2 redis-node3
working-directory: ./test

- name: Start containers for AMQP adapter
if: ${{ matrix.adapter == 'AMQP' }}
run: docker-compose up -d rabbitmq
working-directory: ./test

- name: Start containers for NATS adapter
if: ${{ matrix.adapter == 'NATS' }}
run: docker-compose up -d nats
working-directory: ./test

- name: Start containers for Kafka adapter
if: ${{ matrix.adapter == 'Kafka' }}
run: docker-compose up -d zookeeper kafka
working-directory: ./test

- name: Sleeping 30 secs
Expand All @@ -74,6 +96,7 @@ jobs:
timeout-minutes: 15
env:
GITHUB_ACTIONS_CI: true
ADAPTER: ${{ matrix.adapter }}

# - name: Run leak detection tests
# run: npm run test:leak
Expand All @@ -89,8 +112,8 @@ jobs:
run: docker-compose down -v
working-directory: ./test

- name: Upload code coverage
run: npm run coverall
if: success() && github.ref == 'refs/heads/master'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
# - name: Upload code coverage
# run: npm run coverall
# if: success() && github.ref == 'refs/heads/master'
# env:
# COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
7 changes: 4 additions & 3 deletions test/integration/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ if (process.env.GITHUB_ACTIONS_CI) {
{ type: "AMQP", options: {} },
{ type: "NATS", options: {} },
{ type: "Kafka", options: { kafka: { brokers: ["localhost:9093"] } } }
];
].filter(a => a.name == process.env.ADAPTER || a.type == process.env.ADAPTER);
} else {
// Local development tests
Adapters = [
{ type: "Fake", options: {} },
{ type: "Redis", options: {} },
{
{ type: "Redis", options: {} }
/*{
type: "Redis",
name: "Redis-Cluster",
options: {
Expand All @@ -54,6 +54,7 @@ if (process.env.GITHUB_ACTIONS_CI) {
{ type: "AMQP", options: {} },
{ type: "NATS", options: {} },
{ type: "Kafka", options: { kafka: { brokers: ["localhost:9093"] } } }
*/
];
}

Expand Down

0 comments on commit 299401c

Please sign in to comment.