Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
155de44
vite-meteor [skip ci]
cardoso Jan 14, 2026
9fe8356
fix: avatar [skip ci]
cardoso Jan 15, 2026
3c7d988
fix: assets [skip ci]
cardoso Jan 15, 2026
0e55ad9
fix: context exports [skip ci]
cardoso Jan 15, 2026
fc69718
feat: exclude meteor packages [skip ci]
cardoso Jan 15, 2026
86cb571
chore: replace meteor/promises and meteor/fetchi [skip ci]
cardoso Jan 16, 2026
25422cd
fix: exclude replaced packages [skip ci]
cardoso Jan 16, 2026
9af250f
chore: remove/replace more meteor imports [skip ci]
cardoso Jan 16, 2026
e7b71f0
chore: move vite plugin to a separate file [skip ci]
cardoso Jan 16, 2026
9edd0dd
feat: rocketchat-info plugin [skip ci]
cardoso Jan 16, 2026
f2c81ed
chore: replace/remove more meteor packages [skip ci]
cardoso Jan 16, 2026
f740972
chore: remove ostrio_cookies [skip ci]
cardoso Jan 16, 2026
e4a8e0e
chore: use rolldown parseAst [skip ci]
cardoso Jan 16, 2026
4fed6ab
chore: simplify parsing [skip ci]
cardoso Jan 16, 2026
34fa953
refactor: separate meteor-runtime, meteor-stubs plugins [skip ci]
cardoso Jan 18, 2026
d046648
chore: add lib/ast [skip ci]
cardoso Jan 18, 2026
aef952f
chore: clean up vite-plugin [skip ci]
cardoso Jan 19, 2026
4d732bd
feat(vite): detect localhost [skip ci]
cardoso Jan 20, 2026
69ca468
feat(vite): proxy file uploads [skip ci]
cardoso Jan 20, 2026
32b59e1
chore: refactor [skip ci]
cardoso Jan 22, 2026
7e4f974
refactor: combine meteor plugins [skip ci]
cardoso Jan 22, 2026
8ddbbc0
chore: update deps [skip ci]
cardoso Jan 25, 2026
b867dd1
chore: break circular imports [skip ci]
cardoso Jan 25, 2026
398b1c8
chore: update deps [skip ci]
cardoso Jan 26, 2026
52735cd
chore: DISABLE_SOCK_JS [skip ci]
cardoso Jan 26, 2026
116d3a6
chore: simplify meteor export collection [skip ci]
cardoso Jan 27, 2026
d1d439c
refactor: reduce virtual module logic [skip ci]
cardoso Jan 27, 2026
ceba946
chore: move require to runtime [skip ci]
cardoso Jan 27, 2026
0f3d0a4
refactor: simplify plugins [skip ci]
cardoso Jan 28, 2026
fc2d571
chore: return array of plugins [skip ci]
cardoso Jan 28, 2026
652b660
feat: globals and resolve plugin
cardoso Jan 29, 2026
320d705
chore: inject meteor runtime config in html [skip ci]
cardoso Jan 30, 2026
fe1a173
chore: fix rebase issues [skip ci]
cardoso Jan 30, 2026
adfba4a
feat: build [skip ci]
cardoso Jan 30, 2026
e61d77c
chore: update deps [skip ci]
cardoso Feb 1, 2026
4f2eeae
feat: basic treeshaking of modules.js
cardoso Feb 1, 2026
c4bd367
chore: update vite and oxc deps [skip ci]
cardoso Feb 2, 2026
6fe4ce7
chore: remove stylesheet copy [skip ci]
cardoso Feb 2, 2026
f208fd3
refactor: remove backend files [skip ci]
cardoso Feb 2, 2026
f00c6e1
feat: add base tag to index.html [skip ci]
cardoso Feb 2, 2026
92a632c
refactor: css import path in index.ts [skip ci]
cardoso Feb 2, 2026
b168d2c
chore: remove backend scripts [skip ci]
cardoso Feb 2, 2026
4c92ba8
feat: enable manifest generation in Vite config [skip ci]
cardoso Feb 2, 2026
35097e5
fix: esm build [skip ci]
cardoso Feb 2, 2026
cb314a6
feat: treeshake plugin [skip ci]
cardoso Feb 3, 2026
13f6145
chore: use ctx instead of console [skip ci]
cardoso Feb 3, 2026
5771ccc
chore: remove unused files and scripts [skip ci]
cardoso Feb 3, 2026
dedfbb5
fix: clean up config and add emoji-custom proxy [skip ci]
cardoso Feb 3, 2026
05e9061
fix: update vite entry point [skip ci]
cardoso Feb 4, 2026
c1779eb
feat: treeshaking and dce improvements [skip ci]
cardoso Feb 5, 2026
f8fe309
chore: remove meteor/rocketchat:streamer ambient declaration
cardoso Feb 5, 2026
091178e
chore: simplify treeshaking [skip ci]
cardoso Feb 5, 2026
75ba347
feat: add dockerfiles [skip ci]
cardoso Feb 5, 2026
6ffb930
fix: ROOT_URL and meteor-node-stubs (electron) [skip ci]
cardoso Feb 5, 2026
728961f
feat: meteor module replacement
cardoso Feb 6, 2026
4b346ea
chore: replace meteor/ordered-dict [skip ci]
cardoso Feb 7, 2026
8752322
chore: replace meteor/sha [skip ci]
cardoso Feb 7, 2026
d9cf66c
chore: replace meteor/url [skip ci]
cardoso Feb 7, 2026
64da1d2
chore: replace meteor/service-configuration [skip ci]
cardoso Feb 7, 2026
66c21c6
chore: replace meteor/check [skip ci]
cardoso Feb 7, 2026
7da1b6f
chore: replace meteor/logging [skip ci]
cardoso Feb 7, 2026
df92e3a
chore: replace meteor/{mongo, mongo-id, id-map, ddp-client} [skip ci]
cardoso Feb 7, 2026
de252b0
chore: replace meteor/{meteor,ejson,minimongo,diff-sequence} [skip ci]
cardoso Feb 7, 2026
2560a42
fix: imports/exports [skip ci]
cardoso Feb 7, 2026
739c710
chore: replace meteor/ddp-common [skip ci]
cardoso Feb 7, 2026
4ee9e6e
chore: replace meteor/allow-deny [skip ci]
cardoso Feb 7, 2026
e1f79b5
chore: replace meteor/reload [skip ci]
cardoso Feb 7, 2026
9e19624
chore: replace meteor/geojson-utils [skip ci]
cardoso Feb 7, 2026
bcd451f
chore: refactor reload.ts [skip ci]
cardoso Feb 8, 2026
74add1a
chore: replace meteor/accounts-base [skip ci]
cardoso Feb 8, 2026
d58c43b
chore: refactor geojson-utils.ts [skip ci]
cardoso Feb 8, 2026
2d3e91d
chore: replace meteor/oauth & meteor/accounts-oauth [skip ci]
cardoso Feb 8, 2026
4eea02b
chore: replace meteor/accounts-password [skip ci]
cardoso Feb 8, 2026
4bc761c
chore: replace remaining meteor packages [skip ci]
cardoso Feb 8, 2026
8ec2d34
chore: refactor some meteor replacements [skip ci]
cardoso Feb 8, 2026
9edfc4d
chore: refactor some meteor replacements [skip ci]
cardoso Feb 9, 2026
4b7af53
chore: refactor oauth replacements [skip ci]
cardoso Feb 9, 2026
eedc52b
chore: fix typescript errors [skip ci]
cardoso Feb 10, 2026
f7d0a94
chore: refactor minimongo.ts [skip ci]
cardoso Feb 10, 2026
c879442
chore: more refactors [skip ci]
cardoso Feb 10, 2026
ffe750f
chore: more refactors [skip ci]
cardoso Feb 11, 2026
cf515e1
chore: refactor mongo.ts [skip ci]
cardoso Feb 11, 2026
9858255
feat: add docker-vite.sh script [skip ci]
cardoso Feb 11, 2026
3f9979b
fix: export messages [skip ci]
cardoso Feb 11, 2026
dc0e1fc
chore: refactor accounts-base.ts [skip ci]
cardoso Feb 11, 2026
dcf6c7e
chore: move setup to separate file [skip ci]
cardoso Feb 12, 2026
7e06c61
chore: make meteor client entry noop [skip ci]
cardoso Feb 12, 2026
691336a
chore: refactor ddp-client, minimongo, mongo [skip ci]
cardoso Feb 12, 2026
f24712c
ci: run tests using standalone client (experiment)
cardoso Feb 12, 2026
1f377d8
ci: skip checks for now (experiment)
cardoso Feb 12, 2026
c5e6ee2
ci(vite): install meteor before building backend [experiment]
cardoso Feb 12, 2026
bfc6654
ci(vite): fix path issues
cardoso Feb 12, 2026
346acf1
ci(vite): fix space issues
cardoso Feb 12, 2026
45c0bcc
ci(vite): fix traefik config
cardoso Feb 12, 2026
6be7f2b
ci(vite): update traefik version
cardoso Feb 12, 2026
7e7c7bd
ci(vite): fix traefik routing
cardoso Feb 12, 2026
d234da6
ci(vite): add traefik entry points
cardoso Feb 12, 2026
40f6e93
ci(vite): fix docker api
cardoso Feb 12, 2026
4faa6d4
ci(vite): update traefik
cardoso Feb 12, 2026
fc32e0c
ci(vite): fix backend path
cardoso Feb 13, 2026
e39c2df
ci(vite): fix api and assets routing
cardoso Feb 13, 2026
432d4af
feat(vite): typia stub plugin
cardoso Feb 13, 2026
71e2ce5
feat(vite): stub require
cardoso Feb 13, 2026
04eed5c
feat: replace meteor/{reactive-dict, session}
cardoso Feb 13, 2026
ba5b1a4
ci(vite): proxy i18n
cardoso Feb 13, 2026
95a8b4b
chore: revert changes to server/lib/i18n.ts
cardoso Feb 15, 2026
f0f3fae
fix(vite): proxy meteor_runtime_config.js
cardoso Feb 15, 2026
12f5253
fix: saml routing
cardoso Feb 15, 2026
5882b7e
fix(nginx): add charset
cardoso Feb 15, 2026
a8f9019
chore(vite): add stop script
cardoso Feb 15, 2026
b5a3319
fix(vite): dedupe react-aria and react-stately
cardoso Feb 15, 2026
ee0e4de
fix(vite): dedupe react-i18next, fuselage, and fuselage-hooks
cardoso Feb 16, 2026
e601c6d
chore: undo server-side changes
cardoso Feb 16, 2026
2623d52
fix(vite): saml redirect
cardoso Feb 16, 2026
7800049
ci: update nginx config to emit less logs
cardoso Feb 18, 2026
ea43f11
fix: apply meteor-run-as-user overrides
cardoso Feb 18, 2026
e78a6c3
fix: add some dedupes
cardoso Feb 18, 2026
577953c
fix: alias react-aria
cardoso Feb 18, 2026
f09a8e2
Revert "fix: apply meteor-run-as-user overrides"
cardoso Feb 18, 2026
6516a6f
fix: rebase mistake
cardoso Feb 20, 2026
6765be1
chore: skip cors test
cardoso Feb 20, 2026
b876f99
fix: proxy hooks
cardoso Feb 20, 2026
94c9c40
fix: proxy oauth
cardoso Feb 20, 2026
7eaeb93
fix: proxy matrix
cardoso Feb 20, 2026
aeb6168
fix: proxy ufs
cardoso Feb 21, 2026
735698c
chore: improve frontend build
cardoso Feb 21, 2026
9233835
ci: remove unneeded broken step
cardoso Feb 21, 2026
57a079b
chore: remove old nginx.conf
cardoso Feb 21, 2026
84bb78e
chore: remove temporary code and dependencies
cardoso Feb 21, 2026
82ba746
chore: remove obsolete meteor modules
cardoso Feb 21, 2026
a756876
chore: improve script
cardoso Feb 22, 2026
acc7ed1
chore: sourcemaps in test mode
cardoso Feb 22, 2026
ea571a5
chore: remove dead code
cardoso Feb 22, 2026
d2ee92c
chore: undo more server-side changes
cardoso Feb 22, 2026
e8d1292
chore: remove unused files
cardoso Feb 23, 2026
06885ed
chore: simplify dockerfiles
cardoso Feb 23, 2026
7c4d580
fix: remove SAML debounce
cardoso Feb 23, 2026
59af202
chore: refactor geojson-utils
cardoso Feb 23, 2026
d7feb9a
chore: refactor diff-sequence.ts
cardoso Feb 23, 2026
13c11f0
chore: add script for local e2e testing
cardoso Feb 23, 2026
d9878d9
chore: istanbul coverage
cardoso Feb 23, 2026
3e4a135
chore: update scripts
cardoso Feb 23, 2026
cf76d60
fix: rebase issue
cardoso Feb 23, 2026
dd37c38
chore: safer coverage collection
cardoso Feb 23, 2026
9f4b973
chore: suppress regular nginx logs
cardoso Feb 23, 2026
8b6ec19
chore: always report coverage (temporary)
cardoso Feb 23, 2026
351128f
chore: optimize instrumentation
cardoso Feb 23, 2026
e0cf7d6
chore: update scripts
cardoso Feb 23, 2026
b543b4d
chore: use smaller nginx image for frontend
cardoso Feb 24, 2026
de61072
chore: undo formatting change
cardoso Feb 24, 2026
2e837dc
chore: undo api-client change
cardoso Feb 24, 2026
711b6fe
chore: report coverage even if some tests failed
cardoso Feb 24, 2026
4110c2d
fix: behavior differences in tracker
cardoso Feb 24, 2026
13e7fcc
chore: temporary fix for generate lcov
cardoso Feb 25, 2026
e5864d5
Revert "fix: remove SAML debounce"
cardoso Feb 27, 2026
4172376
chore: update upload-artifact
cardoso Feb 27, 2026
4d77c80
feat: allow serving vite frontend from meteor
cardoso Mar 2, 2026
8707787
chore: update meteor/check replacement
cardoso Mar 2, 2026
e17834f
chore: update scripts
cardoso Mar 2, 2026
f405608
ci: run livechat api test with checks failed (temporary)
cardoso Mar 2, 2026
3630745
chore: improve prune messages test
cardoso Mar 2, 2026
7fbba18
chore: improve omnichannel reports test
cardoso Mar 2, 2026
bc464d0
chore: improve saml tests
cardoso Mar 2, 2026
43b9635
chore: skip sidebar-menu test
cardoso Mar 2, 2026
59d1367
chore: improve omnichannel test
cardoso Mar 2, 2026
b4693ca
chore: improve prune-message test
cardoso Mar 3, 2026
6dd3e59
Revert "chore: improve prune-message test"
cardoso Mar 3, 2026
e13f62f
Revert "chore: improve omnichannel test"
cardoso Mar 3, 2026
4b2c288
Revert "chore: improve saml tests"
cardoso Mar 3, 2026
1b47f81
Revert "chore: improve omnichannel reports test"
cardoso Mar 3, 2026
e56cb7d
Revert "chore: improve prune messages test"
cardoso Mar 3, 2026
4422326
ci: update backend dockerfile
cardoso Apr 15, 2026
6cbce04
ci: fix actionlint problems
cardoso Apr 20, 2026
578c0f5
fix(vite): swiper module resolution
cardoso Apr 28, 2026
a6a4f5b
fix(vite): localhost proxy getURL
cardoso Apr 28, 2026
d351fe6
fix(vite): resolve new apps package imports
cardoso May 8, 2026
d042d1e
chore(deps-dev): update vite to 8.0.14
cardoso May 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
368 changes: 368 additions & 0 deletions .github/workflows/ci-test-e2e-vite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,368 @@
name: Tests E2E (Vite)

on:
workflow_call:
inputs:
node-version:
required: true
type: string
deno-version:
required: true
type: string
lowercase-repo:
required: true
type: string
gh-docker-tag:
required: true
type: string
enterprise-license:
type: string
transporter:
type: string
mongodb-version:
default: "['8.0']"
required: false
type: string
release:
required: true
type: string
shard:
default: "[1]"
required: false
type: string
total-shard:
default: 1
required: false
type: number
retries:
default: 0
required: false
type: number
type:
required: true
type: string
coverage:
required: false
type: string
secrets:
CR_USER:
required: true
CR_PAT:
required: true
NPM_TOKEN:
required: false
QASE_API_TOKEN:
required: false
REPORTER_ROCKETCHAT_URL:
required: false
REPORTER_ROCKETCHAT_API_KEY:
required: false
CODECOV_TOKEN:
required: false
REPORTER_JIRA_ROCKETCHAT_API_KEY:
required: false

env:
MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true
TOOL_NODE_FLAGS: ${{ vars.TOOL_NODE_FLAGS }}
LOWERCASE_REPOSITORY: ${{ inputs.lowercase-repo }}
DOCKER_TAG: ${{ inputs.gh-docker-tag }}-amd64

jobs:
test:
runs-on: ubuntu-24.04

env:
GITHUB_WORKSPACE: ${{ github.workspace }}
DOCKER_TAG_SUFFIX_ROCKETCHAT: ${{ inputs.coverage == matrix.mongodb-version && (github.event_name == 'release' || github.ref == 'refs/heads/develop') && '-cov' || '' }}
MONGODB_VERSION: ${{ matrix.mongodb-version }}
COVERAGE_DIR: "/tmp/coverage/${{ inputs.type }}"
COVERAGE_FILE_NAME: "${{ inputs.type }}-${{ matrix.shard }}.json"
COVERAGE_REPORTER: ${{ inputs.coverage == matrix.mongodb-version && 'json' || '' }}

strategy:
fail-fast: false
matrix:
mongodb-version: ${{ fromJSON(inputs.mongodb-version) }}
shard: ${{ fromJSON(inputs.shard) }}

name: MongoDB ${{ matrix.mongodb-version }}${{ inputs.coverage == matrix.mongodb-version && ' coverage' || '' }} (${{ matrix.shard }}/${{ inputs.total-shard }}) [Vite]

steps:
- name: Collect Workflow Telemetry
if: inputs.type == 'perf'
uses: catchpoint/workflow-telemetry-action@v2
with:
theme: dark
job_summary: true
comment_on_pr: false

- name: Setup kernel limits
run: |
echo "500 65535" > sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
sudo sysctl -w net.ipv4.tcp_mem="383865 511820 2303190"

echo fs.file-max=20000500 | sudo tee -a /etc/sysctl.conf
echo fs.nr_open=20000500 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker system prune -af
df -h

- name: Login to GitHub Container Registry
if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') && github.actor != 'dependabot[bot]'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.CR_USER }}
password: ${{ secrets.CR_PAT }}

- uses: actions/checkout@v6

- name: Setup NodeJS
uses: ./.github/actions/setup-node
with:
node-version: ${{ inputs.node-version }}
deno-version: ${{ inputs.deno-version }}
cache-modules: true
install: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- uses: rharkor/caching-for-turbo@v1.8

- name: Restore packages build
uses: actions/download-artifact@v7
with:
name: packages-build
path: /tmp

- name: Unpack packages build
shell: bash
run: |
tar -xzf /tmp/RocketChat-packages-build.tar.gz -C .

- name: Build Vite frontend
working-directory: ./apps/meteor
env:
VITE_E2E_COVERAGE: ${{ inputs.coverage == matrix.mongodb-version && 'true' || '' }}
run: |
ROOT_URL=http://localhost:3000/ VITE_TEST_MODE=true npx vite build --outDir /tmp/build/dist

- name: Install Meteor
shell: bash
run: |
# Restore bin from cache
set +e
METEOR_SYMLINK_TARGET=$(readlink ~/.meteor/meteor)
METEOR_TOOL_DIRECTORY=$(dirname "$METEOR_SYMLINK_TARGET")
set -e
LAUNCHER=$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor
if [ -e "$LAUNCHER" ]
then
echo "Cached Meteor bin found, restoring it"
sudo cp "$LAUNCHER" "/usr/local/bin/meteor"
else
echo "No cached Meteor bin found."
fi

# only install meteor if bin isn't found
command -v meteor >/dev/null 2>&1 || curl https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh

- name: Build Meteor backend
working-directory: ./apps/meteor
run: |
mkdir -p /tmp/build
meteor build --server-only --directory /tmp/build

# Download Docker images from build artifacts (if needed for EE services)
- name: Download Docker images
uses: actions/download-artifact@v7
if: inputs.release == 'ee' && github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
with:
pattern: "docker-image-*-amd64-coverage"
path: /tmp/docker-images
merge-multiple: true

- name: Load Docker images
if: inputs.release == 'ee' && github.event.pull_request.head.repo.full_name != github.repository && github.event_name != 'release' && github.ref != 'refs/heads/develop'
shell: bash
run: |
set -o xtrace

for image_file in /tmp/docker-images/*.tar; do
if [ -f "$image_file" ]; then
echo "Loading image from $image_file"
docker load -i "$image_file"
rm "$image_file"
fi
done

docker images

- name: Set DEBUG_LOG_LEVEL (debug enabled)
if: runner.debug == '1'
run: echo "DEBUG_LOG_LEVEL=2" >> "$GITHUB_ENV"

- name: Start httpbin container and wait for it to be ready
if: inputs.type == 'api'
run: |
docker compose -f docker-compose-ci-vite.yml up -d httpbin

- name: Prepare code coverage directory
run: |
set -o xtrace

mkdir -p "$COVERAGE_DIR"
chmod 777 "$COVERAGE_DIR"

- name: Start containers for CE
if: inputs.release == 'ce'
run: |
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci-vite.yml up -d rocketchat frontend --wait

- name: Start containers for EE
if: inputs.release == 'ee'
env:
ENTERPRISE_LICENSE: ${{ inputs.enterprise-license }}
TRANSPORTER: ${{ inputs.transporter }}
run: |
DEBUG_LOG_LEVEL=${DEBUG_LOG_LEVEL:-0} docker compose -f docker-compose-ci-vite.yml up -d --wait

- name: Verify Traefik routing
run: |
set -o xtrace
docker ps

# Give Traefik time to discover services
sleep 5

# Show Traefik discovered routers via API
echo "=== Traefik discovered HTTP routers ==="
curl -s http://localhost:8081/api/http/routers | jq '.' || echo "Failed to query Traefik API"

echo "=== Traefik discovered HTTP services ==="
curl -s http://localhost:8081/api/http/services | jq '.' || echo "Failed to query Traefik API"

# Wait for Traefik to discover the frontend service
echo "Waiting for frontend to be accessible via Traefik..."
for i in {1..30}; do
STATUS=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/)
echo "Attempt $i: Got status code $STATUS"
if [ "$STATUS" = "200" ]; then
echo "Frontend is accessible!"
break
fi
if [ "$i" -eq 30 ]; then
echo "Frontend not accessible after 30 attempts"
echo "=== Traefik logs ==="
docker compose -f docker-compose-ci-vite.yml logs traefik
echo "=== Frontend logs ==="
docker compose -f docker-compose-ci-vite.yml logs frontend
echo "=== Curl verbose output ==="
curl -v http://localhost:3000/ || true
exit 1
fi
sleep 2
done

- uses: ./.github/actions/setup-playwright
if: inputs.type == 'ui'

- name: Wait services to start up
if: inputs.release == 'ee'
run: |
docker ps

until docker compose -f docker-compose-ci-vite.yml logs ddp-streamer-service | grep -q "NetworkBroker started successfully"; do
echo "Waiting 'ddp-streamer' to start up"
((c++)) && ((c==10)) && docker compose -f docker-compose-ci-vite.yml logs ddp-streamer-service && exit 1
sleep 10
done;

- name: Remove unused Docker images
run: docker system prune -af

- name: E2E Test API
if: inputs.type == 'api'
working-directory: ./apps/meteor
env:
WEBHOOK_TEST_URL: "http://httpbin"
IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }}
run: |
set -o xtrace

npm run testapi
s=$?

docker compose -f ../../docker-compose-ci-vite.yml stop

ls -la "$COVERAGE_DIR"
exit "$s"

- name: E2E Test UI (${{ matrix.shard }}/${{ inputs.total-shard }})
if: inputs.type == 'ui'
env:
E2E_COVERAGE: ${{ inputs.coverage == matrix.mongodb-version && 'true' || '' }}
IS_EE: ${{ inputs.release == 'ee' && 'true' || '' }}
REPORTER_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_ROCKETCHAT_API_KEY }}
REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }}
REPORTER_JIRA_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_JIRA_ROCKETCHAT_API_KEY }}
REPORTER_ROCKETCHAT_REPORT: ${{ github.event.pull_request.draft != 'true' && secrets.REPORTER_ROCKETCHAT_URL != '' && 'true' || '' }}
REPORTER_ROCKETCHAT_RUN: ${{ github.run_number }}
REPORTER_ROCKETCHAT_BRANCH: ${{ github.ref }}
REPORTER_ROCKETCHAT_DRAFT: ${{ github.event.pull_request.draft }}
REPORTER_ROCKETCHAT_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
REPORTER_ROCKETCHAT_AUTHOR: ${{ github.event.pull_request.user.login }}
REPORTER_ROCKETCHAT_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
REPORTER_ROCKETCHAT_PR: ${{ github.event.pull_request.number }}
QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }}
QASE_REPORT: ${{ github.ref == 'refs/heads/develop' && 'true' || '' }}
CI: true
PLAYWRIGHT_RETRIES: ${{ inputs.retries }}
working-directory: ./apps/meteor
run: |
set -o xtrace

yarn prepare
yarn test:e2e --shard=${{ matrix.shard }}/${{ inputs.total-shard }}

- name: Merge ui coverage files
if: inputs.type == 'ui' && inputs.coverage == matrix.mongodb-version && always()
working-directory: ./apps/meteor
run: |
npx nyc merge .nyc_output "${COVERAGE_DIR}/${COVERAGE_FILE_NAME}"
ls -la "$COVERAGE_DIR" || true

- name: Store playwright test trace
if: inputs.type == 'ui' && always()
uses: actions/upload-artifact@v7
with:
name: playwright-test-trace-vite-${{ inputs.release }}-${{ matrix.mongodb-version }}-${{ matrix.shard }}
path: ./apps/meteor/tests/e2e/.playwright*
include-hidden-files: true

- name: Show server logs if E2E test failed
if: failure()
run: docker compose -f docker-compose-ci-vite.yml logs rocketchat frontend authorization-service queue-worker-service ddp-streamer-service account-service presence-service omnichannel-transcript-service

- name: Show mongo logs if E2E test failed
if: failure()
run: docker compose -f docker-compose-ci-vite.yml logs mongo

- name: Show traefik logs if E2E test failed
if: failure()
run: docker compose -f docker-compose-ci-vite.yml logs traefik

- name: Store coverage
if: inputs.coverage == matrix.mongodb-version && always()
uses: actions/upload-artifact@v7
with:
name: coverage-vite-${{ inputs.type }}-${{ matrix.shard }}
path: /tmp/coverage
include-hidden-files: true
Loading
Loading