trion-development / docker-ng-cli-e2e Goto Github PK
View Code? Open in Web Editor NEWAngular end2end tests inside docker
License: MIT License
Angular end2end tests inside docker
License: MIT License
Hi,
Thanks for the great box. However, the most recent update broke our tests for our Angular 5 containers. When I try to revert to the 1.7.4 tag, I get this error:
session not created exception: Chrome version must be >= 66.0.3359.0
Is it still possible to test Angular 5 applications using any version of this box?
Thanks,
froodley
Hello, do you plane to make alpine version?
we use the dockerimage in combination with playwright which uses the newest chrome drivers(Version 87.0.4280.20 )
it would be great if u can update the chrome install
I'm using ng-cli-e2e in version 14.2.3 with Cypress and it fails with a timeout when running a CI job in Gitlab:
Gitlab CI Runner Logfile:
Running with gitlab-runner 15.3.0 (bbcb5aba)
on b071ad009b1d G7wiHR6B
Preparing the "docker" executor 00:12
Using Docker executor with image trion/ng-cli-e2e:14.2.3 ...
Pulling docker image trion/ng-cli-e2e:14.2.3 ...
Using docker image sha256:214c55005e4a52b5a7e3b3ab9b1873e8148c8a62fa7622988a3176be4a4a7be8 for trion/ng-cli-e2e:14.2.3 with digest trion/ng-cli-e2e@sha256:3ee85941251bddcddc9902b7bcb849a0b7cc107eca76d474917b82a7f9107fb9 ...
Preparing environment 00:01
Running on runner-g7wihr6b-project-8-concurrent-0 via 37574714b23c...
Getting source from Git repository 00:08
$ rm -f /builds/*/*/.git/shallow.lock
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /builds/frontend/web/.git/
Checking out 205f85ec as main...
Removing dist/
Removing node_modules/
Skipping Git submodules setup
Downloading artifacts 00:02
Downloading artifacts for build (550)...
Downloading artifacts from coordinator... ok id=550 responseStatus=200 OK token=29LmYZXn
Executing "step_script" stage of the job script
Using docker image sha256:214c55005e4a52b5a7e3b3ab9b1873e8148c8a62fa7622988a3176be4a4a7be8 for trion/ng-cli-e2e:14.2.3 with digest trion/ng-cli-e2e@sha256:3ee85941251bddcddc9902b7bcb849a0b7cc107eca76d474917b82a7f9107fb9 ...
$ npm ci
added 1232 packages, and audited 1233 packages in 48s
168 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
$ ng e2e
Passing watch mode to DevServer - watch mode is true
- Generating browser application bundles (phase: setup)...
๐ผ daisyUI components 2.28.0 https://github.com/saadeghi/daisyui
โ๏ธ Including: base, components, themes[1], utilities
๐ผ daisyUI components 2.28.0 https://github.com/saadeghi/daisyui
โ๏ธ Including: base, components, themes[1], utilities
โ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
vendor.js | vendor | 2.10 MB |
polyfills.js | polyfills | 319.56 kB |
styles.css, styles.js | styles | 235.69 kB |
main.js | main | 64.49 kB |
runtime.js | runtime | 6.52 kB |
| Initial Total | 2.71 MB
Build at: 2022-09-21T12:08:25.109Z - Hash: e9f8b6e50da9d093 - Time: 27251ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
โ Compiled successfully.
It looks like this is your first time using Cypress: 10.8.0
[STARTED] Task without title.
[SUCCESS] Task without title.
Opening Cypress...
[483:0921/120838.039416:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
ERROR: Job failed: execution took longer than 1h0m0s seconds
.gitlab-ci:
build:
stage: build
image: trion/ng-cli
before_script:
- npm ci
script:
- ng build
# was: - ng build --prod
artifacts:
expire_in: 1 day
paths:
- dist/
# tags:
# - docker
variables:
CLI_VERSION: 14.2.3
test:karma:
stage: test
image: trion/ng-cli-karma:${CLI_VERSION}
allow_failure: false
before_script:
- npm ci
script:
- ng test --progress false --watch false
# tags:
# - docker
test:e2e:
stage: test
image: trion/ng-cli-e2e:${CLI_VERSION}
allow_failure: false
before_script:
- npm ci
script:
- ng e2e
# tags:
# - docker
test:coverage:
stage: test
image: trion/ng-cli-karma
allow_failure: false
before_script:
- npm ci
script:
- ng test --code-coverage --progress false --watch false
#coverage: '/Lines \W+: (\d+\.\d+)%.*/'
coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts:
paths:
- coverage/
# tags:
# - docker
test:nglint:
stage: test
image: trion/ng-cli:${CLI_VERSION}
before_script:
- npm ci
script:
- ng lint
# tags:
# - docker
push-gitlab-docker-registry:
image: docker:latest
stage: deploy
only:
- main
script:
- docker build -t registry.git.mydomain.de/username/project .
- docker login -u username -p $CI_BUILD_TOKEN registry.git.mydomain.de
- docker push registry.git.mydomain.de/username/project
push-docker-registry:
image: docker:latest
stage: deploy
only:
- master
script:
- docker build -t username/project .
- docker login -u username -p $DOCKER_HUB_BUILD_TOKEN
- docker push username/project
Can you see any reason why it fails?
Hi,
I'm getting the following error:
E/direct - Error code: 135
[08:20:59] E/direct - Error message: Could not find chromedriver at /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30. Run 'webdriver-manager update' to download binaries.
[08:20:59] E/direct - Error: Could not find chromedriver at /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30. Run 'webdriver-manager update' to download binaries.
I notice you have instruction about locking the Chrome version but I might not be following it correctly cause it's giving me the following error:
Error: Could not find chromedriver at /app/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_84.0.4147.30. Run 'webdriver-manager update' to download binaries.
Ultimately I trying to had that to my gitlab-ci. This is what I have:
test:e2e:
stage: test
extends: .tags
image: trion/ng-cli-e2e:${CLI_VERSION}
allow_failure: false
script:
- ./node_modules/protractor/node_modules/webdriver-manager/bin/webdriver-manager update --versions.chrome 84.0.4147.30
- ng e2e --webdriver-update=false
Thanks,
Yves
I'm using this docker image as part of my bitbucket pipeline build. All steps (npm install, ng lint, ng test) are working fine but during ng e2e I'm getting the following:
- ng e2e
** NG Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152 **
Hash: e430f7f504f5f4f0bdf5
Time: 27710ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 282 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 230 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 366 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 4.23 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
[21:18:11] I/file_manager - creating folder /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium
[21:18:11] I/update - chromedriver: unzipping chromedriver_2.30.zip
[21:18:12] I/update - chromedriver: setting permissions to 0755 for /opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.30
[21:18:12] I/launcher - Running 1 instances of WebDriver
[21:18:12] I/direct - Using ChromeDriver directly...
[21:18:12] E/launcher - Server terminated early with status 127
[21:18:12] E/launcher - Error: Server terminated early with status 127
at Error (native)
at earlyTermination.catch.e (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/remote/index.js:252:52)
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: WebDriver.createSession()
at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at Function.createSession (/opt/atlassian/pipelines/agent/build/node_modules/selenium-webdriver/chrome.js:709:29)
at Direct.getNewDriver (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/driverProviders/direct.ts:90:25)
at Runner.createBrowser (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/opt/atlassian/pipelines/agent/build/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:796:13)
at ./node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:137:13)
at flush (/opt/atlassian/pipelines/agent/build/node_modules/protractor/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
[21:18:12] E/launcher - Process exited with error code 199
am I missing any config or there is a bug in current version?
Looking at the Dockerfile, I only see adding some JAVA stuff to the docker-ng-cli-karma image. I mean, why? What is the intense of docker-ng-cli-e2e?
image trion/ng-cli-e2e:7.2.3
command: ng test --watch false
Error:
ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss) Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (67) For more information on which environments are supported please see: https://github.com/sass/node-sass/releases/tag/v4.9.3
On trion/ng-cli-e2e:7.2.2 we don't have any problems with sass
This version of ChromeDriver only supports Chrome version 74
current chrome installed in this docker image is v73.x
It took a while, but in the end I have an example presenting my problem with latest (slim) image
Empty angular project with yarn
project.zip
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli:7.2.3 yarn
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli-e2e:7.2.3 ng test
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli yarn
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli-e2e ng test
with error:
04 02 2019 12:08:03.280:ERROR [karma-server]: { Error: spawn ps ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ps',
path: 'ps',
spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 13 ] }
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli:7.2.3 yarn
docker run -u $(id -u) --rm -v `pwd`/project/:/app trion/ng-cli-e2e ng test
with error:
ERROR in ./src/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding /app/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 11.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (/app/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/app/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.sassLoader (/app/node_modules/sass-loader/lib/loader.js:46:72)
@ ./src/styles.scss 2:14-241
@ multi ./src/styles.scss
04 02 2019 12:04:29.444:ERROR [karma-server]: { Error: spawn ps ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ps',
path: 'ps',
spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 13 ] }
The last error look like in my previous ticket: #8 (but then both images was on latest)
When I try to run ng e2e on my CI server's build (AWS CodeBuild, if it matters) using this Docker image, I get this error:
136 | [01:59:25] I/config_source - curl -o/codebuild/output/src043248699/src/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
137 | [01:59:25] I/downloader - curl -o/codebuild/output/src043248699/src/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_83.0.4103.39.zip https://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip
138 | [01:59:25] I/update - chromedriver: unzipping chromedriver_83.0.4103.39.zip
139 | [01:59:25] I/update - chromedriver: setting permissions to 0755 for /codebuild/output/src043248699/src/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_83.0.4103.39
140 | [01:59:25] I/launcher - Running 1 instances of WebDriver
141 | [01:59:25] I/direct - Using ChromeDriver directly...
142 | [01:59:25] E/launcher - Server terminated early with status 127
143 | [01:59:25] E/launcher - Error: Server terminated early with status 127
144 | at earlyTermination.catch.e (/codebuild/output/src043248699/src/node_modules/selenium-webdriver/remote/index.js:252:52)
145 | at process._tickCallback (internal/process/next_tick.js:68:7)
146 | From: Task: WebDriver.createSession()
147 | at Function.createSession (/codebuild/output/src043248699/src/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
148 | at Function.createSession (/codebuild/output/src043248699/src/node_modules/selenium-webdriver/chrome.js:761:15)
149 | at Direct.getNewDriver (/codebuild/output/src043248699/src/node_modules/protractor/built/driverProviders/direct.js:77:33)
150 | at Runner.createBrowser (/codebuild/output/src043248699/src/node_modules/protractor/built/runner.js:195:43)
151 | at q.then.then (/codebuild/output/src043248699/src/node_modules/protractor/built/runner.js:339:29)
152 | at _fulfilled (/codebuild/output/src043248699/src/node_modules/protractor/node_modules/q/q.js:834:54)
153 | at /codebuild/output/src043248699/src/node_modules/protractor/node_modules/q/q.js:863:30
154 | at Promise.promise.promiseDispatch (/codebuild/output/src043248699/src/node_modules/protractor/node_modules/q/q.js:796:13)
155 | at /codebuild/output/src043248699/src/node_modules/protractor/node_modules/q/q.js:556:49
156 | at runSingle (/codebuild/output/src043248699/src/node_modules/protractor/node_modules/q/q.js:137:13)
157 | [01:59:25] E/launcher - Process exited with error code 199
Is there anything in protractor.conf.js that we need to set differently to run it in Docker?
Can you build the 8.0.1 tag to dockerhub?
After the latest update (11.2.3), our Concourse job using this image and another job using trion/ng-cli-karma started failing due to a lack of permissions. We did not make any changes to our job scripts; the only thing that changed was the image tag. For now we will downgrade to 11.2.2, but hope you can add admin privileges back to the container.
When trying to run
apt-get update -yq
we get the below error:
Reading package lists...
E: List directory /var/lib/apt/lists/partial is missing. - Acquire (13: Permission denied)
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Also, when trying to run
npm install
we get the below error:
25hnpm WARN checkPermissions Missing write access to /tmp/build/7650dcdc/<app_name>/<frontend>
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /tmp/build/7650dcdc/<app_name>/<frontend>
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/tmp/build/7650dcdc/<app_name>/<frontend>'
npm ERR! [Error: EACCES: permission denied, access '/tmp/build/7650dcdc/<app_name>/<frontend>'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/tmp/build/7650dcdc/<app_name>/<frontend>'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/.npm/_logs/2021-03-04T21_24_14_154Z-debug.log
Add support for Playwright
https://github.com/microsoft/playwright
Running docker run -u $(id -u) --rm -v "$PWD":/app trion/ng-cli-e2e ng e2e
works as expected.
This container seems to run the angular application on port 49152
I have a backend container running on the network on port 3000
Any idea how I can make sure the database is connected. perhaps via link?
Getting this error docker: Error response from daemon: Cannot link to /kilterly_server_1, as it does not belong to the default network.
when trying to run : docker run --link $(SERVER_CONTAINER) -....
Stack Trace
[22:09:21] E/launcher - Server was killed with SIGSEGV
[22:09:21] E/launcher - Error: Server was killed with SIGSEGV
at earlyTermination.catch.e (/app/node_modules/selenium-webdriver/remote/index.js:252:52)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession (/app/node_modules/selenium-webdriver/lib/webdriver.js:777:24)
at Function.createSession (/app/node_modules/selenium-webdriver/chrome.js:709:29)
at Direct.getNewDriver (/app/node_modules/protractor/lib/driverProviders/direct.ts:90:25)
at Runner.createBrowser (/app/node_modules/protractor/lib/runner.ts:225:39)
at q.then.then (/app/node_modules/protractor/lib/runner.ts:391:27)
at _fulfilled (/app/node_modules/protractor/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/app/node_modules/protractor/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/app/node_modules/protractor/node_modules/q/q.js:796:13)
at /app/node_modules/protractor/node_modules/q/q.js:556:49
at runSingle (/app/node_modules/protractor/node_modules/q/q.js:137:13)
at flush (/app/node_modules/protractor/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.