Запускаю karma тесты для Angular в gitlab CI.
.gitlab-ci.yml:
image: node:14.0.0
cache:
paths:
- node_modules/
before_script:
- npm install
- apt-get update -qq
- apt-get install -y -qq rsync
- apt-get install -y -qq sshpass
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
- apt install ./google-chrome-stable_current_amd64.deb -y
stages:
- testing_deploy
build_and_deploy_testing:
stage: testing_deploy
script:
- echo "============== ADD DEVELOP SSH KEY =============="
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- echo "============== START BUILD AND DEPLOY TESTING =============="
- ./node_modules/@angular/cli/bin/ng test --progress false --watch=false
Failed job сообщение:
12 01 2021 16:25:31.828:ERROR [launcher]: Cannot start Chrome
[2172:2172:0112/162531.552480:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
12 01 2021 16:25:31.829:ERROR [launcher]: Chrome stdout:
12 01 2021 16:25:31.829:ERROR [launcher]: Chrome stderr: [2172:2172:0112/162531.552480:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
12 01 2021 16:25:31.840:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
Cleaning up file based variables
ERROR: Job failed: exit code 1
Как это исправить?