代码拉取完成,页面将自动刷新
task:
# On Cirrus CI, cron tasks does not start if it has
# manual trigger type enabled - expected behaviour
# see: https://github.com/cirruslabs/cirrus-ci-docs/discussions/949#discussioncomment-1853964
matrix:
# Keep manual trigger for all pushes (prs and merges)
- trigger_type: manual
only_if: $CIRRUS_CRON == ''
# Only trigger task automatically if it's a cron and main branch
- trigger_type: automatic
only_if: $CIRRUS_CRON != '' && $BRANCH == "main"
name: E2E/Integration Tests
timeout_in: 45
container:
image: ubuntu:20.04
kvm: true # required for E2E/Integrations tests
cpu: 8
memory: 16G
env:
DEBIAN_FRONTEND: noninteractive
CI: true
CIRRUS_CLONE_DEPTH: 0 # Required to get app version
FORCE_COLOR: 1 # force terminal color
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 # disable auto-browser download
KEYRING: /usr/share/keyrings/nodesource.gpg
NODE_VERSION: node_16.x # set node version e.g: "node_17.x" for Node 17 LTS
SUDO_NON_ROOT_CMD: sudo --login --user=ranchertest
# Setting up a non-root user
prepare_user_script:
- groupadd --gid $(stat -c '%g' /dev/kvm) kvm
- useradd --create-home --groups kvm ranchertest
- tar c --owner=ranchertest . | tar x --directory=/home/ranchertest
- chown -R ranchertest:ranchertest /home/ranchertest
install_deps_script: |
apt-get update
apt-get install -y --no-install-recommends ca-certificates gcc g++ curl git golang openssh-client make netcat sudo vim gpg lsb-core \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
# The process to install Node w/o sudo|bash requires a validation:
# Step.1 - Check if node package is available on nodesource, if not it will fail
# Step.2 - Add node key and update source list
# Step.3 - Update source and install node+npm
install_node_script: |
export DISTRO="$(lsb_release --short --codename)"
curl --silent --location --fail --output /dev/null "https://deb.nodesource.com/${NODE_VERSION}/dists/${DISTRO}/Release"
curl --silent https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor > "$KEYRING"
echo "deb [signed-by=${KEYRING}] https://deb.nodesource.com/${NODE_VERSION} ${DISTRO} main" > /etc/apt/sources.list.d/nodesource.list
echo "deb-src [signed-by=${KEYRING}] https://deb.nodesource.com/${NODE_VERSION} ${DISTRO} main" >> /etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install --yes nodejs
node --version && npm --version
# Info about Cirrus CI caching see: https://cirrus-ci.org/guide/writing-tasks/#cache-instruction
node_modules_cache:
folder: /home/ranchertest/node_modules
fingerprint_script: cat package-lock.json
populate_script:
# Passing DEBUG=pw:install in order to verify if all Playwright deps were installed properly
- ${SUDO_NON_ROOT_CMD} DEBUG=pw:install npm ci
- ${SUDO_NON_ROOT_CMD} ./node_modules/.bin/playwright install-deps
# Ensure the tools were installed properly
post_install_script:
- ${SUDO_NON_ROOT_CMD} node scripts/postinstall.mjs
test_script:
- export KUBECONFIG=/home/ranchertest/.kube/config
- ${SUDO_NON_ROOT_CMD} CI=1 xvfb-run --auto-servernum -- npm run test:e2e
on_failure:
# custom_script workaround for cirrus bug: https://github.com/cirruslabs/cirrus-ci-agent/issues/197
# Still broken after cirrus fix, addressing a new issue to them. (Jan.06 2022)
custom_script: |
mkdir e2e/reports/
cp -R /home/ranchertest/e2e/reports/* /tmp/cirrus-ci-build/e2e/reports/
playwright_artifacts:
path: "/tmp/cirrus-ci-build/e2e/reports/*"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。