Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
1449c43
vite-meteor [skip ci]
cardoso Jan 14, 2026
dcaf45f
fix: avatar [skip ci]
cardoso Jan 15, 2026
8012a51
fix: assets [skip ci]
cardoso Jan 15, 2026
5280f7f
fix: context exports [skip ci]
cardoso Jan 15, 2026
e99d7a7
feat: exclude meteor packages [skip ci]
cardoso Jan 15, 2026
5c44fd2
chore: replace meteor/promises and meteor/fetchi [skip ci]
cardoso Jan 16, 2026
d4c2d61
fix: exclude replaced packages [skip ci]
cardoso Jan 16, 2026
8581dc8
chore: remove/replace more meteor imports [skip ci]
cardoso Jan 16, 2026
0b3cd1a
chore: move vite plugin to a separate file [skip ci]
cardoso Jan 16, 2026
df544f0
feat: rocketchat-info plugin [skip ci]
cardoso Jan 16, 2026
71b6bf8
chore: replace/remove more meteor packages [skip ci]
cardoso Jan 16, 2026
60600ab
chore: remove ostrio_cookies [skip ci]
cardoso Jan 16, 2026
503fadf
chore: use rolldown parseAst [skip ci]
cardoso Jan 16, 2026
0c4b32c
chore: simplify parsing [skip ci]
cardoso Jan 16, 2026
8242ec2
refactor: separate meteor-runtime, meteor-stubs plugins [skip ci]
cardoso Jan 18, 2026
aaa0735
chore: add lib/ast [skip ci]
cardoso Jan 18, 2026
fb88e07
chore: clean up vite-plugin [skip ci]
cardoso Jan 19, 2026
0ed9956
feat(vite): detect localhost [skip ci]
cardoso Jan 20, 2026
1cbaafb
feat(vite): proxy file uploads [skip ci]
cardoso Jan 20, 2026
f20921c
chore: refactor [skip ci]
cardoso Jan 22, 2026
263408f
refactor: combine meteor plugins [skip ci]
cardoso Jan 22, 2026
696480e
chore: update deps [skip ci]
cardoso Jan 25, 2026
483e8f6
chore: break circular imports [skip ci]
cardoso Jan 25, 2026
cbcc274
chore: update deps [skip ci]
cardoso Jan 26, 2026
cb195aa
chore: DISABLE_SOCK_JS [skip ci]
cardoso Jan 26, 2026
0aae3eb
chore: simplify meteor export collection [skip ci]
cardoso Jan 27, 2026
75c8aa6
refactor: reduce virtual module logic [skip ci]
cardoso Jan 27, 2026
32a773c
chore: move require to runtime [skip ci]
cardoso Jan 27, 2026
f3eb25d
refactor: simplify plugins [skip ci]
cardoso Jan 28, 2026
f4cca89
chore: return array of plugins [skip ci]
cardoso Jan 28, 2026
968f386
feat: globals and resolve plugin
cardoso Jan 29, 2026
9a94edb
chore: inject meteor runtime config in html [skip ci]
cardoso Jan 30, 2026
ac4b3f2
chore: fix rebase issues [skip ci]
cardoso Jan 30, 2026
fdfc32c
feat: build [skip ci]
cardoso Jan 30, 2026
ad0a952
chore: update deps [skip ci]
cardoso Feb 1, 2026
c064d4e
feat: basic treeshaking of modules.js
cardoso Feb 1, 2026
f26d93b
chore: update vite and oxc deps [skip ci]
cardoso Feb 2, 2026
ff47a5a
chore: remove stylesheet copy [skip ci]
cardoso Feb 2, 2026
cdac1fb
refactor: remove backend files [skip ci]
cardoso Feb 2, 2026
f81f19e
feat: add base tag to index.html [skip ci]
cardoso Feb 2, 2026
b7c83ac
refactor: css import path in index.ts [skip ci]
cardoso Feb 2, 2026
e42876d
chore: remove backend scripts [skip ci]
cardoso Feb 2, 2026
381195f
feat: enable manifest generation in Vite config [skip ci]
cardoso Feb 2, 2026
75c4421
fix: esm build [skip ci]
cardoso Feb 2, 2026
ed027e6
feat: treeshake plugin [skip ci]
cardoso Feb 3, 2026
e08c344
chore: use ctx instead of console [skip ci]
cardoso Feb 3, 2026
671fb74
chore: update deps [skip ci]
cardoso Feb 3, 2026
63e324a
chore: remove unused files and scripts [skip ci]
cardoso Feb 3, 2026
d33fb4c
fix: clean up config and add emoji-custom proxy [skip ci]
cardoso Feb 3, 2026
29740be
chore: remove rocketchat:streamer meteor package
cardoso Feb 4, 2026
9a59d66
fix: update vite entry point [skip ci]
cardoso Feb 4, 2026
400b081
feat: treeshaking and dce improvements [skip ci]
cardoso Feb 5, 2026
6550817
chore: remove meteor/rocketchat:streamer ambient declaration
cardoso Feb 5, 2026
b86a4b7
chore: simplify treeshaking [skip ci]
cardoso Feb 5, 2026
5cd89b2
feat: add dockerfiles [skip ci]
cardoso Feb 5, 2026
62be0b7
fix: ROOT_URL and meteor-node-stubs (electron) [skip ci]
cardoso Feb 5, 2026
2cbbbe7
chore: update vite [skip ci]
cardoso Feb 6, 2026
8014ee7
feat: meteor module replacement
cardoso Feb 6, 2026
427def8
chore: replace meteor/ordered-dict [skip ci]
cardoso Feb 7, 2026
26895f9
chore: replace meteor/sha [skip ci]
cardoso Feb 7, 2026
949ffcb
chore: replace meteor/url [skip ci]
cardoso Feb 7, 2026
fbf0a39
chore: replace meteor/service-configuration [skip ci]
cardoso Feb 7, 2026
cf1c686
chore: replace meteor/check [skip ci]
cardoso Feb 7, 2026
465ee3a
chore: replace meteor/logging [skip ci]
cardoso Feb 7, 2026
6650ca3
chore: replace meteor/{mongo, mongo-id, id-map, ddp-client} [skip ci]
cardoso Feb 7, 2026
3af842d
chore: replace meteor/{meteor,ejson,minimongo,diff-sequence} [skip ci]
cardoso Feb 7, 2026
ee4f652
fix: imports/exports [skip ci]
cardoso Feb 7, 2026
4d32ff8
chore: replace meteor/ddp-common [skip ci]
cardoso Feb 7, 2026
b43a39f
chore: replace meteor/allow-deny [skip ci]
cardoso Feb 7, 2026
17a86f7
chore: replace meteor/reload [skip ci]
cardoso Feb 7, 2026
2237fee
chore: replace meteor/geojson-utils [skip ci]
cardoso Feb 7, 2026
abe2ad2
chore: refactor reload.ts [skip ci]
cardoso Feb 8, 2026
ddf585d
chore: replace meteor/accounts-base [skip ci]
cardoso Feb 8, 2026
3a9fe95
chore: refactor geojson-utils.ts [skip ci]
cardoso Feb 8, 2026
0b715f9
chore: replace meteor/oauth & meteor/accounts-oauth [skip ci]
cardoso Feb 8, 2026
b834656
chore: replace meteor/accounts-password [skip ci]
cardoso Feb 8, 2026
0f5c427
chore: replace remaining meteor packages [skip ci]
cardoso Feb 8, 2026
578a3af
chore: refactor some meteor replacements [skip ci]
cardoso Feb 8, 2026
ddcacf1
chore: refactor some meteor replacements [skip ci]
cardoso Feb 9, 2026
d2b073e
chore: refactor oauth replacements [skip ci]
cardoso Feb 9, 2026
f27a606
chore: fix typescript errors [skip ci]
cardoso Feb 10, 2026
ca2552b
chore: refactor minimongo.ts [skip ci]
cardoso Feb 10, 2026
5eb164d
chore: more refactors [skip ci]
cardoso Feb 10, 2026
c3b5039
chore: more refactors [skip ci]
cardoso Feb 11, 2026
43b635a
chore: refactor mongo.ts [skip ci]
cardoso Feb 11, 2026
539dd73
feat: add docker-vite.sh script [skip ci]
cardoso Feb 11, 2026
9b0b29c
fix: export messages [skip ci]
cardoso Feb 11, 2026
3118f39
chore: refactor accounts-base.ts [skip ci]
cardoso Feb 11, 2026
aa1d551
chore: move setup to separate file [skip ci]
cardoso Feb 12, 2026
e64ee5c
chore: make meteor client entry noop [skip ci]
cardoso Feb 12, 2026
d2bc0b7
chore: refactor ddp-client, minimongo, mongo [skip ci]
cardoso Feb 12, 2026
6ed6597
ci: run tests using standalone client (experiment)
cardoso Feb 12, 2026
d61e2bd
ci: skip checks for now (experiment)
cardoso Feb 12, 2026
c0b4f9d
ci(vite): install meteor before building backend [experiment]
cardoso Feb 12, 2026
68ef154
ci(vite): fix path issues
cardoso Feb 12, 2026
ac868b5
ci(vite): fix space issues
cardoso Feb 12, 2026
37eca3e
ci(vite): fix traefik config
cardoso Feb 12, 2026
b9b702c
ci(vite): update traefik version
cardoso Feb 12, 2026
032a182
ci(vite): fix traefik routing
cardoso Feb 12, 2026
ec5d4ca
ci(vite): add traefik entry points
cardoso Feb 12, 2026
5c76678
ci(vite): fix docker api
cardoso Feb 12, 2026
a691f77
ci(vite): update traefik
cardoso Feb 12, 2026
793bcf1
ci(vite): fix backend path
cardoso Feb 13, 2026
1b2fc98
ci(vite): fix api and assets routing
cardoso Feb 13, 2026
e3d5b95
feat(vite): typia stub plugin
cardoso Feb 13, 2026
8dce51c
feat(vite): stub require
cardoso Feb 13, 2026
14e16ae
feat: replace meteor/{reactive-dict, session}
cardoso Feb 13, 2026
c31b67b
ci(vite): proxy i18n
cardoso Feb 13, 2026
97fb639
fix(ddp-streamer): missing msg field
cardoso Feb 13, 2026
07e21da
chore: revert changes to server/lib/i18n.ts
cardoso Feb 15, 2026
4fbfa6c
chore: update dependencies
cardoso Feb 15, 2026
b31db6a
fix(vite): proxy meteor_runtime_config.js
cardoso Feb 15, 2026
4df8aa1
fix: saml routing
cardoso Feb 15, 2026
d573f2f
fix(nginx): add charset
cardoso Feb 15, 2026
16c5ca3
chore(vite): add stop script
cardoso Feb 15, 2026
fb59945
fix(vite): dedupe react-aria and react-stately
cardoso Feb 15, 2026
2a44458
fix(vite): dedupe react-i18next, fuselage, and fuselage-hooks
cardoso Feb 16, 2026
3642b7f
chore: undo server-side changes
cardoso Feb 16, 2026
d4fd78e
fix(vite): saml redirect
cardoso Feb 16, 2026
4d0fbd9
ci: update nginx config to emit less logs
cardoso Feb 18, 2026
50550ea
fix: apply meteor-run-as-user overrides
cardoso Feb 18, 2026
eec0567
fix: add some dedupes
cardoso Feb 18, 2026
6fe791d
fix: alias react-aria
cardoso Feb 18, 2026
4c3a5b9
Revert "fix: apply meteor-run-as-user overrides"
cardoso Feb 18, 2026
2aee030
fix: rebase mistake
cardoso Feb 20, 2026
df638d6
chore: update vite
cardoso Feb 20, 2026
879c8de
chore: skip cors test
cardoso Feb 20, 2026
5445a41
fix: proxy hooks
cardoso Feb 20, 2026
47203b8
fix: proxy oauth
cardoso Feb 20, 2026
2556a41
fix: proxy matrix
cardoso Feb 20, 2026
12eaa97
fix: proxy ufs
cardoso Feb 21, 2026
3020d37
chore: improve frontend build
cardoso Feb 21, 2026
239ecd4
ci: remove unneeded broken step
cardoso Feb 21, 2026
a982dcc
chore: remove old nginx.conf
cardoso Feb 21, 2026
4719e46
chore: remove temporary code and dependencies
cardoso Feb 21, 2026
0923b13
chore: remove obsolete meteor modules
cardoso Feb 21, 2026
e3eaa83
chore: improve script
cardoso Feb 22, 2026
217485c
chore: sourcemaps in test mode
cardoso Feb 22, 2026
53f40ce
chore: remove dead code
cardoso Feb 22, 2026
bf78c93
chore: undo more server-side changes
cardoso Feb 22, 2026
b067049
chore: remove unused files
cardoso Feb 23, 2026
125ed51
chore: simplify dockerfiles
cardoso Feb 23, 2026
b296a6e
fix: remove SAML debounce
cardoso Feb 23, 2026
86f6651
chore: refactor geojson-utils
cardoso Feb 23, 2026
e7062e9
chore: refactor diff-sequence.ts
cardoso Feb 23, 2026
3a8f1f8
chore: add script for local e2e testing
cardoso Feb 23, 2026
c7fb485
chore: istanbul coverage
cardoso Feb 23, 2026
fe2a13b
chore: update scripts
cardoso Feb 23, 2026
2496641
fix: rebase issue
cardoso Feb 23, 2026
422fff7
chore: safer coverage collection
cardoso Feb 23, 2026
3664563
chore: suppress regular nginx logs
cardoso Feb 23, 2026
747afce
chore: always report coverage (temporary)
cardoso Feb 23, 2026
f209506
chore: optimize instrumentation
cardoso Feb 23, 2026
9eb7865
chore: update scripts
cardoso Feb 23, 2026
c6645f8
chore: use smaller nginx image for frontend
cardoso Feb 24, 2026
c2564fe
chore: undo formatting change
cardoso Feb 24, 2026
00f192c
chore: undo api-client change
cardoso Feb 24, 2026
3f7386a
chore: report coverage even if some tests failed
cardoso Feb 24, 2026
145cff6
fix: behavior differences in tracker
cardoso Feb 24, 2026
ccccf95
chore: temporary fix for generate lcov
cardoso Feb 25, 2026
76e00bf
Revert "fix: remove SAML debounce"
cardoso Feb 27, 2026
3cc6ec0
chore: update upload-artifact
cardoso Feb 27, 2026
70ccdba
chore: update vite
cardoso Feb 27, 2026
08e0c2d
feat: allow serving vite frontend from meteor
cardoso Mar 2, 2026
b81342b
chore: update meteor/check replacement
cardoso Mar 2, 2026
dd6b23b
chore: make saml test less flaky
cardoso Mar 2, 2026
deb87c6
chore: update scripts
cardoso Mar 2, 2026
a5a75bf
ci: run livechat api test with checks failed (temporary)
cardoso Mar 2, 2026
78e3ff6
chore: improve prune messages test
cardoso Mar 2, 2026
7da94ba
chore: improve omnichannel reports test
cardoso Mar 2, 2026
b30415b
chore: improve saml tests
cardoso Mar 2, 2026
35dcfa2
chore: skip sidebar-menu test
cardoso Mar 2, 2026
bbd8446
chore: improve omnichannel test
cardoso Mar 2, 2026
84a21cb
chore: improve prune-message test
cardoso Mar 3, 2026
0d7b2fd
Revert "chore: make saml test less flaky"
cardoso Mar 3, 2026
f2d2a80
Revert "chore: improve prune-message test"
cardoso Mar 3, 2026
e2abfae
Revert "chore: improve omnichannel test"
cardoso Mar 3, 2026
aa84f4c
Revert "chore: improve saml tests"
cardoso Mar 3, 2026
0f2988d
Revert "chore: improve omnichannel reports test"
cardoso Mar 3, 2026
32264f6
Revert "chore: improve prune messages test"
cardoso Mar 3, 2026
b83bd58
chore(deps-dev): update vite
cardoso Mar 9, 2026
6533f90
chore(deps-dev): update react vite plugin
cardoso Mar 9, 2026
5c941e8
chore(deps-dev): update vite
cardoso Mar 12, 2026
66ac1b1
chore: update vite-plugin-istanbul
cardoso Mar 18, 2026
a95c84f
chore: update vite
cardoso Mar 20, 2026
e67351b
chore: update vite
cardoso Mar 23, 2026
f332162
chore: update vite
cardoso Mar 27, 2026
a1d6353
chore: update vite
cardoso Apr 14, 2026
661f63e
ci: update backend dockerfile
cardoso Apr 15, 2026
723d1ac
chore: update yarn.lock
cardoso Apr 20, 2026
7cf5d4b
chore: update vite
cardoso Apr 20, 2026
a35e05a
ci: fix actionlint problems
cardoso Apr 20, 2026
99b2e1e
fix(vite): swiper module resolution
cardoso Apr 28, 2026
cb39ab8
fix(vite): localhost proxy getURL
cardoso Apr 28, 2026
8f66f2b
chore(deps-dev): update vite to 8.0.10
cardoso Apr 28, 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