Skip to content

Commit 3279b9f

Browse files
committed
fix(ci): running karma tests
1 parent 6558c9f commit 3279b9f

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,7 @@ jobs:
9393
DOCKER_BUILDKIT=1 docker build . --file ./Test.Dockerfile --tag ilc:tmp-test-client --build-arg BASE_IMAGE=namecheap/ilc_tmp:$SHA
9494
9595
- name: Run client-side tests
96-
run: |
97-
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
98-
sudo sysctl -p
99-
docker run --volume $(pwd)/artifacts/ilc/coverage/client:/.coverage ilc:tmp-test-client bash -c "npm run test:client -- --browsers ChromeHeadlessWithoutSecurity && mv .karma_output/* /.coverage"
96+
run: docker run --volume $(pwd)/artifacts/ilc/coverage/client:/codebase/.karma_output/coverage ilc:tmp-test-client
10097

10198
- uses: actions/upload-artifact@v6
10299
with:

ilc/Test.Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1+
# syntax=docker/dockerfile:1.7-labs
12
ARG BASE_IMAGE=namecheap/ilc
23

3-
FROM $BASE_IMAGE
4+
FROM $BASE_IMAGE AS bundle
45

5-
RUN apk update && apk add --no-cache chromium chromium-chromedriver
6+
FROM node:22-alpine3.19
7+
8+
RUN apk update && apk add --no-cache build-base python3 chromium chromium-chromedriver
9+
10+
WORKDIR /codebase
11+
12+
COPY --from=bundle --exclude=node_modules /codebase .
13+
14+
RUN npm ci --prefer-offline --no-fund
615

716
ENV CHROME_BIN=/usr/bin/chromium-browser
817
ENV CHROME_DRIVER=/usr/bin/chromedriver
918
ENV NODE_ENV=test
1019

11-
CMD ["npm", "run", "test:client"]
20+
CMD ["npm", "run", "test:client", "--", "--browsers", "ChromeHeadlessWithoutSecurity"]

ilc/karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ module.exports = function (config) {
3636
browsers: ['ChromeHeadless'],
3737
customLaunchers: {
3838
ChromeHeadlessWithoutSecurity: {
39-
base: 'ChromeHeadless',
40-
flags: ['--no-sandbox'],
39+
base: 'ChromiumHeadless',
40+
flags: ['--no-sandbox', '--headless=new'],
4141
},
4242
},
4343
customContextFile: './tests/karma.index.html',

0 commit comments

Comments
 (0)