Skip to content

Commit 3b55b30

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

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
@@ -162,7 +162,7 @@ jobs:
162162
run: echo "DEBUG_LOG_LEVEL=2" >> "$GITHUB_ENV"
163163

164164
- name: Start httpbin container and wait for it to be ready
165-
if: inputs.type == 'api' || inputs.type == 'api-livechat'
165+
if: startsWith(inputs.type, 'api')
166166
run: |
167167
docker compose -f docker-compose-ci.yml up -d httpbin
168168
@@ -181,7 +181,7 @@ jobs:
181181
# behavior on (rate-limiter bypass, short cache TTLs) while letting
182182
# the deprecation logger log without throwing. Other suites use the
183183
# docker-compose default of TEST_MODE='true'.
184-
TEST_MODE: ${{ (inputs.type == 'api' || inputs.type == 'api-livechat') && 'api' || 'true' }}
184+
TEST_MODE: ${{ startsWith(inputs.type, 'api') && 'api' || 'true' }}
185185
run: |
186186
# when we are testing CE, we only need to start the rocketchat container
187187
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d rocketchat --wait
@@ -192,7 +192,8 @@ jobs:
192192
ENTERPRISE_LICENSE: ${{ inputs.enterprise-license }}
193193
TRANSPORTER: ${{ inputs.transporter }}
194194
COMPOSE_PROFILES: ${{ inputs.type == 'api' && 'api' || '' }}
195-
TEST_MODE: ${{ (inputs.type == 'api' || inputs.type == 'api-livechat') && 'api' || 'true' }}
195+
TEST_MODE: ${{ startsWith(inputs.type, 'api') && 'api' || 'true' }}
196+
APPS_ENGINE_RUNTIME_BACKEND: ${{ inputs.type == 'api-apps-node' && 'node' || '' }}
196197
run: |
197198
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci.yml up -d --wait
198199
@@ -229,6 +230,23 @@ jobs:
229230
ls -la "$COVERAGE_DIR"
230231
exit "${s:-0}"
231232
233+
# This step should be temporary, only here until we remove the deno-runtime
234+
- name: E2E Test API (apps + node-runtime)
235+
if: (inputs.type == 'api-apps-node' && inputs.release == 'ee')
236+
working-directory: ./apps/meteor
237+
env:
238+
WEBHOOK_TEST_URL: 'http://httpbin'
239+
IS_EE: 'true'
240+
run: |
241+
set -o xtrace
242+
243+
npm run testapi:apps || s=$?
244+
245+
docker compose -f ../../docker-compose-ci.yml stop
246+
247+
ls -la "$COVERAGE_DIR"
248+
exit "${s:-0}"
249+
232250
- name: E2E Test API (Livechat)
233251
if: inputs.type == 'api-livechat'
234252
working-directory: ./apps/meteor

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,27 @@ jobs:
650650
CR_PAT: ${{ secrets.CR_PAT }}
651651
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
652652

653+
test-api-apps-node-ee:
654+
name: 🔨 Test API Apps (node-runtime - EE)
655+
needs: [checks, build-gh-docker-publish, release-versions]
656+
657+
uses: ./.github/workflows/ci-test-e2e.yml
658+
with:
659+
type: api-apps-node
660+
release: ee
661+
transporter: 'nats://nats:4222'
662+
enterprise-license: ${{ needs.release-versions.outputs.enterprise-license }}
663+
mongodb-version: "['8.0']"
664+
coverage: '8.0'
665+
node-version: ${{ needs.release-versions.outputs.node-version }}
666+
deno-version: ${{ needs.release-versions.outputs.deno-version }}
667+
lowercase-repo: ${{ needs.release-versions.outputs.lowercase-repo }}
668+
gh-docker-tag: ${{ needs.release-versions.outputs.gh-docker-tag }}
669+
secrets:
670+
CR_USER: ${{ secrets.CR_USER }}
671+
CR_PAT: ${{ secrets.CR_PAT }}
672+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
673+
653674
test-ui-ee:
654675
name: 🔨 Test UI (EE)
655676
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)