Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Add dev-env-integration tests to prow #678

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions jenkins/jobs/dev_env_integration_tests.pipeline
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ def CLEAN_TIMEOUT = 600
def TIMEOUT = 7200

script {
if ("${PROJECT_REPO_ORG}" == "metal3-io" && "${PROJECT_REPO_NAME}" == "project-infra") {
echo "Checkout ${ghprbAuthorRepoGitUrl} branch ${ghprbActualCommit}"
ci_git_branch="${ghprbActualCommit}"
ci_git_url = "${ghprbAuthorRepoGitUrl}"
if ("${env.REPO_OWNER}" == "metal3-io" && "${env.REPO_NAME}" == "project-infra") {
echo "Checkout https://github.com/${env.REPO_OWNER}/${env.REPO_NAME}.git branch ${env.PULL_PULL_SHA}"
ci_git_branch = (env.PULL_PULL_SHA) ?: "main"
ci_git_url = "https://github.com/${env.REPO_OWNER}/${env.REPO_NAME}.git"
ci_git_base = (env.PULL_BASE_REF) ?: "main"
// Fetch the base branch and the ci_git_branch when running on project-infra PR
refspec = '+refs/heads/' + ci_git_base + ':refs/remotes/origin/' + ci_git_base + ' ' + ci_git_branch
} else {
echo "Checkout ${ghprbAuthorRepoGitUrl} main"
ci_git_branch = "main"
ci_git_url = "https://github.com/metal3-io/project-infra.git"
refspec = '+refs/heads/*:refs/remotes/origin/*'
}
agent_label="metal3ci-medium-${IMAGE_OS}"
}
Expand All @@ -24,13 +27,11 @@ pipeline {
agent { label agent_label }
environment {
METAL3_CI_USER="metal3ci"
REPO_ORG = "${PROJECT_REPO_ORG}"
REPO_NAME = "${PROJECT_REPO_NAME}"
UPDATED_REPO = "${ghprbAuthorRepoGitUrl}"
REPO_BRANCH = "${ghprbTargetBranch}"
UPDATED_BRANCH = "${ghprbActualCommit}"
REPO_ORG = "${env.REPO_OWNER}"
REPO_NAME = "${env.REPO_NAME}"
REPO_BRANCH = "${env.PULL_BASE_REF}"
Copy link
Member

@Sunnatillo Sunnatillo Mar 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This varibale needed to run for PR tests. Please add it here and jjb PR as well
PR_ID = "${env.PULL_NUMBER}"

BUILD_TAG = "${env.BUILD_TAG}"
PR_ID = "${ghprbPullId}"
PR_ID = "${env.PULL_NUMBER}"
IMAGE_OS = "${IMAGE_OS}"
CAPI_VERSION = "${CAPI_VERSION}"
CAPM3_VERSION = "${CAPM3_VERSION}"
Expand Down Expand Up @@ -69,7 +70,8 @@ pipeline {
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: ci_git_credential_id,
url: ci_git_url
url: ci_git_url,
refspec: refspec
]
]
])
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case we run the test on PR open on metal3-io org from nordix branch:
in line 52 when we clone the repo https://github.com/${REPO_ORG}/${REPO_NAME}.git this should clone the metal3-io repo how do we merge the nordix branch changes that we want to test

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any suggestions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

refspec is added to solve the issue

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ CI_DIR="$(dirname "$(readlink -f "${0}")")"
export IMAGE_OS="${IMAGE_OS:-ubuntu}"
export REPO_ORG="${REPO_ORG:-metal3-io}"
export REPO_NAME="${REPO_NAME:-metal3-dev-env}"
export REPO_BRANCH="${REPO_BRANCH:-main}"
export PR_ID="${PR_ID:-}"
export PULL_PULL_SHA="${PULL_PULL_SHA:-}"
export METAL3REPO="${METAL3REPO:-https://github.com/metal3-io/metal3-dev-env.git}"
export METAL3BRANCH="${METAL3BRANCH:-main}"
export CAPM3RELEASEBRANCH="${CAPM3RELEASEBRANCH:-main}"
Expand Down
165 changes: 165 additions & 0 deletions prow/manifests/overlays/metal3/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,39 @@ presubmits:
agent: jenkins
always_run: false
optional: true
# name: dev-env-integration-test-{image_os}-{capm3_target_branch}
- name: dev-env-integration-test-centos-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-4
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-4
agent: jenkins
always_run: false
optional: true
metal3-io/cluster-api-provider-metal3:
- name: gomod
branches:
Expand Down Expand Up @@ -1625,6 +1658,39 @@ presubmits:
agent: jenkins
always_run: false
optional: true
# name: dev-env-integration-test-{image_os}-{capm3_target_branch}
- name: dev-env-integration-test-centos-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-4
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-4
agent: jenkins
always_run: false
optional: true
metal3-io/community:
- name: markdownlint
run_if_changed: '(\.md|markdownlint\.sh)$'
Expand Down Expand Up @@ -1915,6 +1981,39 @@ presubmits:
agent: jenkins
always_run: false
optional: true
# name: dev-env-integration-test-{image_os}-{capm3_target_branch}
- name: dev-env-integration-test-centos-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-4
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-4
agent: jenkins
always_run: false
optional: true
metal3-io/project-infra:
- name: check-prow-config
skip_if_only_changed: '(((^|/)OWNERS)|(\.md))$'
Expand Down Expand Up @@ -2192,6 +2291,39 @@ presubmits:
agent: jenkins
always_run: false
optional: true
# name: dev-env-integration-test-{image_os}-{capm3_target_branch}
- name: dev-env-integration-test-centos-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-4
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-4
agent: jenkins
always_run: false
optional: true
metal3-io/metal3-docs:
- name: markdownlint
run_if_changed: '(\.md|markdownlint\.sh)$'
Expand Down Expand Up @@ -2808,6 +2940,39 @@ presubmits:
agent: jenkins
always_run: false
optional: true
# name: dev-env-integration-test-{image_os}-{capm3_target_branch}
- name: dev-env-integration-test-centos-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-centos-release-1-4
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-main
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-6
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-5
agent: jenkins
always_run: false
optional: true
- name: dev-env-integration-test-ubuntu-release-1-4
agent: jenkins
always_run: false
optional: true
metal3-io/ironic-ipa-downloader:
- name: shellcheck
run_if_changed: '((\.sh)|^Makefile)$'
Expand Down
Loading