Skip to content

Commit

Permalink
chore: adapted gui jobs to changed repo setup & aligned e2e test setup
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Zedel <[email protected]>
  • Loading branch information
mzedel committed Sep 5, 2024
1 parent 73c282e commit 5d069ad
Show file tree
Hide file tree
Showing 6 changed files with 347 additions and 333 deletions.
141 changes: 138 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,40 @@ variables:

include:
- project: "Northern.tech/Mender/mendertesting"
file: ".gitlab-ci-check-commits.yml"
- project: "Northern.tech/Mender/mendertesting"
file: ".gitlab-ci-github-status-updates.yml"
file:
- ".gitlab-ci-check-commits.yml"
- ".gitlab-ci-github-status-updates.yml"
- local: "/frontend/pipeline.yml"

stages:
- pre-test
- build
- test
- e2e-test
- publish
- version-bump
- test-deploy

.dind-login: &dind-login
- mkdir -p $HOME/.docker && echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json

test-prep:staging:
stage: pre-test
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker
rules:
- if: $CI_COMMIT_BRANCH == "staging"
services:
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:dind
alias: docker
script:
- docker run --rm --entrypoint "/bin/sh" -v $(pwd):/extract mendersoftware/mender-stress-test-client:master -c "cp mender-stress-test-client /extract/"
artifacts:
paths:
- mender-stress-test-client
expire_in: 30 days
tags:
- hetzner-amd-beefy

build:backend:dist:
image: golang:${GOLANG_VERSION}
stage: build
Expand Down Expand Up @@ -127,3 +150,115 @@ test:backend:integration:
- backend/report_integration_*.html
reports:
junit: backend/results_integration_*.xml

coveralls:done:
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/curlimages/curl
stage: .post
script:
- curl "https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN" -d "payload[build_num]=$CI_PIPELINE_ID&payload[status]=done"
tags:
- hetzner-amd-beefy

#
# Mender Helm Rolling release
#
.trigger:mender-helm-version-bump:
stage: version-bump
allow_failure: true
trigger:
project: Northern.tech/Mender/mender-helm
strategy: depend
resource_group: mender-helm
variables:
SYNC_CONTAINER_NAME: $CONTAINER_NAME
SYNC_IMAGE_TAG: $DOCKER_PUBLISH_COMMIT_TAG
CONTAINER: gui
DOCKER_PUBLISH_COMMIT_TAG: ${CI_COMMIT_REF_NAME}_${CI_COMMIT_SHA}
GITHUB_HELM_REPO: "github.com/mendersoftware/mender-helm.git"
CHART_DIR: "mender"

trigger:mender-helm-version-bump:staging:
extends:
- .trigger:mender-helm-version-bump
rules:
- if: $CI_COMMIT_BRANCH =~ /^(staging)$/
variables:
SYNC_ENVIRONMENT: staging
HELM_PATCH_VERSION: ${CI_PIPELINE_ID}-staging # pre-release version for trigger staging only deploy

trigger:mender-helm-version-bump:prod:
extends:
- .trigger:mender-helm-version-bump
rules:
- if: "$CI_COMMIT_TAG =~ /^saas-[a-zA-Z0-9.]+$/"
when: manual
variables:
SYNC_ENVIRONMENT: prod
HELM_PATCH_VERSION: ${CI_PIPELINE_ID}
DOCKER_PUBLISH_COMMIT_TAG: ${CI_COMMIT_REF_NAME}

#
# Test Staging Deployment
#
.template:test:staging-deployment:
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mendersoftware/mender-test-containers:gui-e2e-testing
stage: test-deploy
services:
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:dind
alias: docker
cache:
key:
files:
- frontend/tests/e2e_tests/package-lock.json
paths:
- frontend/.npm/
needs:
- job: trigger:mender-helm-version-bump:staging
artifacts: false
- job: test:prep
artifacts: true
variables:
CI: 1
DEVICE_TYPE: qemux86-64
TEST_ENVIRONMENT: staging
before_script:
- curl -fsSL https://get.docker.com | sh
- mv mender-stress-test-client frontend/tests/e2e_tests/ && cd frontend/tests/e2e_tests
- docker pull mendersoftware/mender-client-docker-addons:mender-3.6.x
- npm ci --cache .npm --prefer-offline
script:
- npm run test
after_script:
- cd $CI_PROJECT_DIR
- mkdir logs && cp /root/frontend/tests/e2e_tests/.npm/_logs/* logs/
only:
- staging
artifacts:
expire_in: 2w
paths:
- frontend/tests/e2e_tests/test-results
- logs
when: always
tags:
- hetzner-amd-beefy-privileged

test:staging-deployment:chrome:
extends: .template:test:staging-deployment
script:
- npm run test
when: delayed
start_in: 1 minutes

test:staging-deployment:firefox:
extends: .template:test:staging-deployment
script:
- npm run test -- --browser=firefox
when: delayed
start_in: 25 minutes

test:staging-deployment:webkit:
extends: .template:test:staging-deployment
script:
- npm run test -- --browser=webkit
when: delayed
start_in: 15 minutes
Loading

0 comments on commit 5d069ad

Please sign in to comment.