Skip to content

Commit d4d9fb1

Browse files
committed
chore(ci): add dedicated CI step for node-runtime tests
1 parent c216960 commit d4d9fb1

5 files changed

Lines changed: 59 additions & 3 deletions

File tree

.github/workflows/ci-test-e2e.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
run: echo "DEBUG_LOG_LEVEL=2" >> "$GITHUB_ENV"
168168

169169
- name: Start httpbin container and wait for it to be ready
170-
if: inputs.type == 'api' || inputs.type == 'api-livechat'
170+
if: startsWith(inputs.type, 'api')
171171
run: |
172172
docker compose -f docker-compose-ci.yml up -d httpbin
173173
@@ -186,7 +186,7 @@ jobs:
186186
# behavior on (rate-limiter bypass, short cache TTLs) while letting
187187
# the deprecation logger log without throwing. Other suites use the
188188
# docker-compose default of TEST_MODE='true'.
189-
TEST_MODE: ${{ (inputs.type == 'api' || inputs.type == 'api-livechat') && 'api' || 'true' }}
189+
TEST_MODE: ${{ startsWith(inputs.type, 'api') && 'api' || 'true' }}
190190
run: |
191191
# when we are testing CE, we only need to start the rocketchat container
192192
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d rocketchat --wait
@@ -197,7 +197,8 @@ jobs:
197197
ENTERPRISE_LICENSE: ${{ inputs.enterprise-license }}
198198
TRANSPORTER: ${{ inputs.transporter }}
199199
COMPOSE_PROFILES: ${{ inputs.type == 'api' && 'api' || '' }}
200-
TEST_MODE: ${{ (inputs.type == 'api' || inputs.type == 'api-livechat') && 'api' || 'true' }}
200+
TEST_MODE: ${{ startsWith(inputs.type, 'api') && 'api' || 'true' }}
201+
APPS_ENGINE_RUNTIME_BACKEND: ${{ inputs.type == 'api-apps-node' && 'node' || '' }}
201202
run: |
202203
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d --wait
203204
@@ -234,6 +235,23 @@ jobs:
234235
ls -la "$COVERAGE_DIR"
235236
exit "${s:-0}"
236237
238+
# This step should be temporary, only here until we remove the deno-runtime
239+
- name: E2E Test API (apps + node-runtime)
240+
if: (inputs.type == 'api-apps-node' && inputs.release == 'ee')
241+
working-directory: ./apps/meteor
242+
env:
243+
WEBHOOK_TEST_URL: 'http://httpbin'
244+
IS_EE: 'true'
245+
run: |
246+
set -o xtrace
247+
248+
npm run testapi:apps || s=$?
249+
250+
docker compose -f ../../docker-compose-ci.yml stop
251+
252+
ls -la "$COVERAGE_DIR"
253+
exit "${s:-0}"
254+
237255
- name: E2E Test API (Livechat)
238256
if: inputs.type == 'api-livechat'
239257
working-directory: ./apps/meteor

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,27 @@ jobs:
657657
CR_PAT: ${{ secrets.CR_PAT }}
658658
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
659659

660+
test-api-apps-node-ee:
661+
name: 🔨 Test API Apps (node-runtime - EE)
662+
needs: [checks, build-gh-docker-publish, release-versions]
663+
664+
uses: ./.github/workflows/ci-test-e2e.yml
665+
with:
666+
type: api-apps-node
667+
release: ee
668+
transporter: 'nats://nats:4222'
669+
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
670+
mongodb-version: "['8.0']"
671+
coverage: '8.0'
672+
node-version: ${{ needs.release-versions.outputs.node-version }}
673+
deno-version: ${{ needs.release-versions.outputs.deno-version }}
674+
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
675+
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
676+
secrets:
677+
CR_USER: ${{ secrets.CR_USER }}
678+
CR_PAT: ${{ secrets.CR_PAT }}
679+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
680+
660681
test-ui-ee:
661682
name: 🔨 Test UI (EE)
662683
needs: [checks, build-gh-docker-publish, release-versions]

apps/meteor/.mocharc.api.apps.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
/*
4+
* Mocha configuration for REST API integration tests.
5+
*/
6+
7+
module.exports = /** @satisfies {import('mocha').MochaOptions} */ ({
8+
...require('./.mocharc.base.json'), // see https://github.com/mochajs/mocha/issues/3916
9+
timeout: 10000,
10+
bail: false,
11+
retries: 0,
12+
file: 'tests/end-to-end/teardown.ts',
13+
reporter: 'tests/end-to-end/reporter.ts',
14+
spec: ['tests/end-to-end/apps/*'],
15+
});

apps/meteor/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"test:e2e:nyc": "nyc report --reporter=lcovonly",
5757
"testapi": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.js",
5858
"testapi:livechat": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.livechat.js",
59+
"testapi:apps": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --config ./.mocharc.api.apps.js",
5960
"testunit": "yarn .testunit:definition && yarn .testunit:jest && yarn .testunit:server:cov",
6061
"testunit-watch": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha --watch --config ./.mocharc.js",
6162
"typecheck": "meteor lint && cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" tsc --noEmit --skipLibCheck",

docker-compose-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
image: ghcr.io/${LOWERCASE_REPOSITORY}/rocket.chat:${DOCKER_TAG}${DOCKER_TAG_SUFFIX_ROCKETCHAT:-}
1515
environment:
1616
- 'TEST_MODE=${TEST_MODE:-true}'
17+
- APPS_ENGINE_RUNTIME_BACKEND=${APPS_ENGINE_RUNTIME_BACKEND:-}
1718
- DEBUG=${DEBUG:-}
1819
- EXIT_UNHANDLEDPROMISEREJECTION=true
1920
- MONGO_URL=mongodb://mongo:27017/rocketchat?replicaSet=rs0

0 commit comments

Comments
 (0)