Skip to content

Commit

Permalink
chore: trigger integration tests
Browse files Browse the repository at this point in the history
* Trigger integration tests
* Install requirements for release_tool.py from the checked out branch
  instead of getting it from master

Ticket: QA-828

Signed-off-by: Daniel Skinstad Drabitzius <[email protected]>
  • Loading branch information
danielskinstad committed Feb 3, 2025
1 parent 371cc05 commit 1170204
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 15 deletions.
3 changes: 1 addition & 2 deletions gitlab-pipeline/stage/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ build:client:docker:
- echo "failure" > /JOB_RESULT.txt
# Dependencies
- apk --update add python3 py-pip curl jq bash git xz
- wget https://raw.githubusercontent.com/mendersoftware/integration/master/extra/requirements.txt
- pip3 install --break-system-packages -r requirements.txt
# Post job status
- ${CI_PROJECT_DIR}/scripts/github_pull_request_status pending "Gitlab ${CI_JOB_NAME} started" "${CI_JOB_URL}" "${CI_JOB_NAME}/${INTEGRATION_REV}"
# Prepare workspace
Expand All @@ -41,6 +39,7 @@ build:client:docker:
- xz -d /tmp/workspace.tar.xz
- tar -xf /tmp/workspace.tar
script:
- pip3 install --break-system-packages -r ${WORKSPACE}/integration/extra/requirements.txt
- echo ${CI_REGISTRY_PASSWORD} | docker login --username ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
# First build mender's repo Docker image
- docker_url=$($WORKSPACE/integration/extra/release_tool.py --map-name docker mender-client-docker docker_url)
Expand Down
6 changes: 2 additions & 4 deletions gitlab-pipeline/stage/init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ init:workspace:
- export WORKSPACE=$(realpath ${CI_PROJECT_DIR}/..)
- apk --update add git openssh bash python3 curl py3-pip jq xz

# release_tool.py dependencies
- wget https://raw.githubusercontent.com/mendersoftware/integration/master/extra/requirements.txt
- pip3 install -r requirements.txt

# Post job status
- ${CI_PROJECT_DIR}/scripts/github_pull_request_status pending "Gitlab ${CI_JOB_NAME} started" "${CI_JOB_URL}" "${CI_JOB_NAME}/${INTEGRATION_REV}"

Expand Down Expand Up @@ -115,6 +111,8 @@ init:workspace:
# should not need it.
- (
- cd integration
# release_tool.py dependencies
- pip3 install -r extra/requirements.txt
# Rename the branch we're on, so that it's not in the way for the
# subsequent fetch. It's ok if this fails, it just means we're not on any
# branch.
Expand Down
57 changes: 48 additions & 9 deletions gitlab-pipeline/stage/trigger-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,58 @@
inherit:
variables: false
variables:
MENDER_CLIENT_TAG: mender-$INTEGRATION_REV
MENDER_GATEWAY_QEMU_TAG: mender-$INTEGRATION_REV
MENDER_GATEWAY_TAG: $MENDER_GATEWAY_REV
MENDER_REGISTRY: registry.gitlab.com
MENDER_DOCKER_REGISTRY: registry.gitlab.com
MENDER_CLIENT_REPOSITORY: northern.tech/mender

MENDER_CLIENT_DOCKER_IMAGE: mender-qa
MENDER_CLIENT_DOCKER_TAG: ${CI_PIPELINE_ID}-mender-client-docker

MENDER_CLIENT_DOCKER_ADDONS_IMAGE: mender-qa
MENDER_CLIENT_DOCKER_ADDONS_TAG: ${CI_PIPELINE_ID}-mender-client-docker-addons

MENDER_CLIENT_QEMU_IMAGE: mender-qa
MENDER_CLIENT_QEMU_TAG: ${CI_PIPELINE_ID}-mender-client-qemu

MENDER_CLIENT_QEMU_ROFS_IMAGE: mender-qa
MENDER_CLIENT_QEMU_ROFS_TAG: ${CI_PIPELINE_ID}-mender-client-qemu-rofs

MENDER_GATEWAY_QEMU_COMMERCIAL_IMAGE: mender-qa
MENDER_GATEWAY_QEMU_COMMERCIAL_TAG: ${CI_PIPELINE_ID}-mender-qemu-rofs-commercial

MENDER_MONITOR_QEMU_COMMERCIAL_IMAGE: mender-qa
MENDER_MONITOR_QEMU_COMMERCIAL_TAG: ${CI_PIPELINE_ID}-mender-monitor-qemu-commercial

MENDER_QEMU_ROFS_COMMERCIAL_IMAGE: mender-qa
MENDER_QEMU_ROFS_COMMERCIAL_TAG: ${CI_PIPELINE_ID}-mender-qemu-rofs-commercial

MENDER_GATEWAY_TAG: ${MENDER_GATEWAY_REV}

RUN_TESTS_FULL_INTEGRATION: "true"
# TODO: remove these parallel 1 overrides whenever tests are stable
CI_JOBS_IN_PARALLEL_INTEGRATION: 1
XDIST_JOBS_IN_PARALLEL_INTEGRATION: 1

trigger:generate-gitlab-integration-rev:
stage: trigger:integration
script:
# Convert INTEGRATION_REV on format `pull/0000/head` to `pr_0000` to specify which gitlab branch to trigger
- |
if [ "$INTEGRATION_REV" != "master" ]; then
GITLAB_INTEGRATION_REV=$(echo $INTEGRATION_REV | awk '{split($0, array, "/"); printf "pr_%s", array[2]}')
else
GITLAB_INTEGRATION_REV=master
fi
- echo "GITLAB_INTEGRATION_REV=$GITLAB_INTEGRATION_REV" >> gitlab_integration_rev.env
artifacts:
reports:
dotenv: gitlab_integration_rev.env

trigger:integration-tests:
extends: .template:trigger:integration-tests
needs: ["trigger:generate-gitlab-integration-rev", "build:client:qemu"]
when: always
trigger:
project: Northern.tech/Mender/integration
branch: $INTEGRATION_REV
branch: $GITLAB_INTEGRATION_REV
strategy: depend

trigger:integration-tests:manual:
needs: []
when: manual
extends: .template:trigger:integration-tests

0 comments on commit 1170204

Please sign in to comment.