--- /dev/null
+---
+#
+# ============LICENSE_START=======================================================
+# Copyright (C) 2022 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+# Description:
+# ============
+# This file contains job template definition for Cluster API Provider Metal3 (CAPM3) e2e integration tests.
+# This job can be triggered manually or through a Github pull request. It creates a
+# pipeline job. The pipeline scripts are maintained in Metal3 CI project infra repository.
+
+- job-template:
+ id: capm3_e2e_integration_tests
+ name: '{job_prefix}_{proj}_e2e_integration_test_{image_os}'
+ description: "CAPM3 e2e integration tests for {org}/{repo} on {image_os}."
+ project-type: pipeline
+ defaults: global
+ disabled: False
+ concurrent: True
+ parameters:
+ - string:
+ name: PROJECT_REPO_ORG
+ default: '{org}'
+ description: 'Project github repo org name'
+ - string:
+ name: PROJECT_REPO_NAME
+ default: '{repo}'
+ description: 'Project github repo name'
+ - string:
+ name: ghprbActualCommit
+ default: 'main'
+ description: 'CI Repo branch for triggering manual build'
+ - string:
+ name: ghprbAuthorRepoGitUrl
+ default: 'https://github.com/{org}/{repo}.git'
+ description: 'CI Repo URL for triggering manual build'
+ - string:
+ name: ghprbTargetBranch
+ default: 'main'
+ description: 'Target branch of the PR'
+ - string:
+ name: IMAGE_OS
+ default: '{image_os}'
+ description: 'Distribution to use for the target host as well as source and target cluster. Can be ubuntu or centos'
+ - string:
+ name: capm3_release_branch
+ default: 'main'
+ description: 'The target branch of CAPM3 to be used for this test'
+ - string:
+ name: CAPI_VERSION
+ default: 'v1beta1'
+ description: 'Cluster API version. E.g. v1beta1.'
+ - string:
+ name: CAPM3_VERSION
+ default: 'v1beta1'
+ description: 'Cluster API provider Metal3 version. E.g. v1beta1.'
+ - string:
+ name: TARGET_NODE_MEMORY
+ default: 4096
+ description: 'RAM size of the target host.'
+ - string:
+ name: TESTS_FOR
+ default: "e2e_tests"
+ description: 'Tests using the e2e framework.'
+ - string:
+ name: GINKGO_FOCUS
+ default: "integration"
+ description: 'Select the e2e integration test'
+
+ properties:
+ - build-discarder:
+ days-to-keep: 30
+ num-to-keep: 300
+ artifact-days-to-keep: -1
+ artifact-num-to-keep: -1
+ - github:
+ url: https://github.com/{org}/{repo}
+
+ triggers:
+ - github-pull-request:
+ admin-list:
+ - '{ci_github_admin_user}'
+ org-list: "{ci_github_whitelist_org}"
+ cron: 'H/5 * * * *'
+ auth-id: "{ci_ghprb_auth_id}"
+ trigger-phrase: '((.|\n)*\s)?/test-{image_os}-integration-e2e-main(\s(.|\n)*)?'
+ skip-build-phrase: '/skip-test'
+ only-trigger-phrase: True
+ github-hooks: True
+ permit-all: False
+ auto-close-on-fail: False
+ allow-whitelist-orgs-as-admins: True
+ white-list-target-branches:
+ - 'main'
+ status-context: "test-{image_os}-integration-e2e-main"
+ success-status: "Passed"
+ failure-status: "Failed"
+ error-status: "Error"
+ cancel-builds-on-update: True
+ pipeline-scm:
+ scm:
+ - git:
+ url: "{ci_github_repo}"
+ credentials-id: "{ci_github_jenkins_credentials_id}"
+ branches:
+ - '{branch|main}'
+ name: 'origin'
+ refspec: '+refs/heads/*:refs/remotes/origin/*'
+ wipe-workspace: True
+ honor-refspec: True
+ shallow-clone: False
+ script-path: "{ci_github_pipeline}"
+ lightweight-checkout: False
name: TESTS_FOR
default: "e2e_tests"
description: 'Tests using the e2e framework.'
-
+ - string:
+ name: GINKGO_SKIP
+ default: "upgrade integration"
+ description: 'Skip non feature e2e test'
+
properties:
- build-discarder:
days-to-keep: 30
name: EPHEMERAL_TEST
default: True
description: 'Select the e2e test in ephemeral cluster'
+ - string:
+ name: GINKGO_SKIP
+ default: "upgrade integration"
+ description: 'Skip non feature e2e test'
properties:
- build-discarder:
name: TESTS_FOR
default: "e2e_tests"
description: 'Tests using the e2e framework.'
-
+ - string:
+ name: GINKGO_SKIP
+ default: "upgrade integration"
+ description: 'Skip non feature e2e test'
+
properties:
- build-discarder:
days-to-keep: 30
allow-whitelist-orgs-as-admins: True
white-list-target-branches:
- 'main'
+ - 'release-1.3'
- 'release-1.2'
- 'release-1.1'
- - 'release-0.5'
- - 'release-0.1'
status-context: "test-features-{image_os}"
success-status: "Passed"
failure-status: "Failed"
allow-whitelist-orgs-as-admins: True
white-list-target-branches:
- 'main'
+ - 'release-1.3'
- 'release-1.2'
- 'release-1.1'
- 'release-0.5'
name: SKIP_DELETION
default: 'true'
description: 'Whether tester VM should be deleted or not by the end of the test'
+ - string:
+ name: GINKGO_SKIP
+ default: "upgrade integration"
+ description: 'Skip non feature e2e test'
properties:
- build-discarder:
artifact-num-to-keep: -1
triggers:
- - timed: "@midnight"
+ - timed: "0 5 */10 * *"
pipeline-scm:
scm:
capm3_release_branch: main
target_branches:
- 'main'
+ - release-1-3:
+ capi_version: v1beta1
+ capm3_version: v1beta1
+ capm3_release_branch: release-1.3
+ target_branches:
+ - 'main'
+ - 'release-1.3'
- release-1-2:
capi_version: v1beta1
capm3_version: v1beta1
target_branches:
- 'main'
- 'release-1.1'
- - release-0-5:
- capi_version: v1alpha4
- capm3_version: v1alpha5
- capm3_release_branch: release-0.5
- target_branches:
- - 'main'
- - 'release-0.5'
- - 'release-0.1'
exclude:
- proj: ironic_ipa_downloader
image_os: centos
- capm3_target_branch: release-0-5
+ capm3_target_branch: release-1-1
jobs:
- integration_tests
capm3_release_branch: main
target_branches:
- 'main'
+ - release-1-3:
+ capi_version: v1beta1
+ capm3_version: v1beta1
+ capm3_release_branch: release-1.3
+ target_branches:
+ - 'main'
+ - 'release-1.3'
- release-1-2:
capi_version: v1beta1
capm3_version: v1beta1
target_branches:
- 'main'
- 'release-1.1'
- - release-0-5:
- capi_version: v1alpha4
- capm3_version: v1alpha5
- capm3_release_branch: release-0.5
- target_branches:
- - 'main'
- - 'release-0.5'
- - 'release-0.1'
jobs:
- keep_integration_tests
capm3_version: v1beta1
capm3_release_branch: main
schedule: "H 4 * * *"
+ - release-1-3:
+ capi_version: v1beta1
+ capm3_version: v1beta1
+ capm3_release_branch: release-1.3
+ schedule: "30 4 * * *"
- release-1-2:
capi_version: v1beta1
capm3_version: v1beta1
capm3_version: v1beta1
capm3_release_branch: release-1.1
schedule: "30 4 * * *"
- - release-0-5:
- capi_version: v1alpha4
- capm3_version: v1alpha5
- capm3_release_branch: release-0.5
- schedule: "30 4 * * *"
- project:
name: bml-tests
capm3_release_branch: main
target_branches:
- 'main'
+ - release-1-3:
+ capi_version: v1beta1
+ capm3_version: v1beta1
+ capm3_release_branch: release-1.3
+ target_branches:
+ - 'release-1.3'
- release-1-2:
capi_version: v1beta1
capm3_version: v1beta1
capm3_release_branch: release-1.1
target_branches:
- 'release-1.1'
- - release-0-5:
- capi_version: v1alpha4
- capm3_version: v1alpha5
- capm3_release_branch: release-0.5
- target_branches:
- - 'release-0.5'
jobs:
- capm3_e2e_upgrade_tests:
exclude:
- image_os: centos
+ - capm3_e2e_integration_tests:
- capm3_e2e_tests_parallel:
- exclude:
- - capm3_target_branch:
- - release-0-5
- capm3_e2e_tests:
- keep_capm3_e2e_tests:
capm3_branch: main
capm3_release_branch: main
schedule: "H 20 * * *"
+ - release-1-3:
+ capi_version: v1beta1
+ capm3_version: v1beta1
+ capm3_branch: release-1.3
+ capm3_release_branch: release-1.3
+ schedule: "H 23 * * *"
- release-1-2:
capi_version: v1beta1
capm3_version: v1beta1
capm3_branch: release-1.1
capm3_release_branch: release-1.1
schedule: "H 23 * * *"
- - release-0-5:
- capi_version: v1alpha4
- capm3_version: v1alpha5
- capm3_branch: release-0.5
- capm3_release_branch: release-0.5
- schedule: "H 23 * * *"
-
- project:
name: 'ironic_image_build_tests'
--- /dev/null
+/*
+Copyright (c) 2022 Nordix Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
+
+node('nordix-nsm-build-ubuntu2204') {
+ build_number = env.BUILD_NUMBER
+ workspace = env.WORKSPACE
+ ws("${workspace}/${build_number}") {
+ def git_project = params.GIT_PROJECT
+ def current_branch = params.CURRENT_BRANCH
+ def default_branch = params.DEFAULT_BRANCH
+
+ def meridio_version = params.MERIDIO_VERSION
+ def tapa_version = params.TAPA_VERSION
+ def kubernetes_version = params.KUBERNETES_VERSION
+ def nsm_version = params.NSM_VERSION
+ def ip_family = params.IP_FAMILY
+ def number_of_workers = params.NUMBER_OF_WORKERS
+ def environment_name = params.ENVIRONMENT_NAME
+ def focus = params.FOCUS
+ def skip = params.SKIP
+
+ def number_of_runs = params.NUMBER_OF_RUNS
+ def interval = params.INTERVAL
+
+ stage('Clone/Checkout') {
+ git branch: default_branch, url: git_project
+ checkout([
+ $class: 'GitSCM',
+ branches: [[name: current_branch]],
+ extensions: [],
+ userRemoteConfigs: [[
+ refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*',
+ url: git_project
+ ]]
+ ])
+ sh 'git show'
+ }
+ timeout(30) {
+ stage('Environment') {
+ def command = "make -s -C test/e2e/environment/$environment_name/ KUBERNETES_VERSION=$kubernetes_version NSM_VERSION=$nsm_version IP_FAMILY=$ip_family KUBERNETES_WORKERS=$number_of_workers MERIDIO_VERSION=$meridio_version TAPA_VERSION=$tapa_version"
+ try {
+ ExecSh(command).call()
+ } catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
+ currentBuild.result = 'ABORTED'
+ } catch (Exception e) {
+ unstable 'Environment setup failed'
+ currentBuild.result = 'FAILURE'
+ }
+ }
+ }
+ stage('E2E List') {
+ E2EList(number_of_runs, interval, environment_name, ip_family, focus, skip).call()
+ }
+ stage('Cleanup') {
+ Cleanup()
+ }
+ }
+}
+
+// Creates the list of e2e to run during this job
+def E2EList(number_of_runs, interval, environment_name, ip_family, focus, skip) {
+ return {
+ def stages = [:]
+ def list = sh(script: "seq -w 1 $number_of_runs | paste -sd ' ' -", returnStdout: true).trim().split(' ')
+ def previous = '0'
+ env.E2E_PREVIOUSLY_EXECUTED = previous
+ for (i in list) {
+ stages.put("$i", E2E(i, previous, interval, environment_name, ip_family, focus, skip))
+ previous = i
+ }
+ parallel(stages)
+ }
+}
+
+// Run e2e
+def E2E(id, previous_id, interval, environment_name, ip_family, focus, skip) {
+ return {
+ stage('Wait for previous') {
+ waitUntil(initialRecurrencePeriod: 15000, quiet: true) {
+ return env.E2E_PREVIOUSLY_EXECUTED == previous_id
+ }
+ }
+ if (previous_id != '0') {
+ stage("Wait $interval seconds") {
+ sh "sleep $interval"
+ }
+ }
+ stage('E2E') {
+ def command = "make e2e E2E_ENVIRONMENT=\"$environment_name\" E2E_IP_FAMILY=\"$ip_family\" E2E_FOCUS=\"$focus\" E2E_SKIP=\"$skip\""
+ try {
+ ExecSh(command).call()
+ } catch (Exception e) {
+ unstable 'Failing e2e'
+ }
+ }
+ env.E2E_PREVIOUSLY_EXECUTED = id
+ }
+}
+
+// Raise error in Jenkins job
+def Error(e) {
+ return {
+ Cleanup()
+ error e
+ }
+}
+
+// Cleanup directory and kind cluster
+def Cleanup() {
+ def command = 'make -s -C docs/demo/scripts/kind/ clean'
+ ExecSh(command).call()
+ cleanWs()
+}
+
+// Execute command
+def ExecSh(command) {
+ return {
+ if (env.DRY_RUN != 'true') {
+ sh """
+ . \${HOME}/.profile
+ ${command}
+ """
+ } else {
+ echo "${command}"
+ }
+ }
+}
--- /dev/null
+---
+# ============LICENSE_START=======================================================
+# Copyright (C) 2021 Nordix Foundation.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END=========================================================
+
+- project:
+ name: 'meridio-e2e-long-run-test-kind'
+
+ project: 'meridio-e2e-long-run-test-kind'
+
+ jobs:
+ - 'meridio-e2e-long-run-test-kind'
+
+- job-template:
+ name: 'meridio-e2e-long-run-test-kind'
+ project-type: pipeline
+ disabled: '{obj:disabled}'
+
+ concurrent: false
+
+ properties:
+ - github:
+ url: https://github.com/Nordix/Meridio-Operator
+
+ parameters:
+ - string:
+ name: GITHUB_ORGANIZATION
+ default: 'Nordix'
+ description: GitHub Organization
+ - string:
+ name: PROJECT
+ default: 'Meridio'
+ description: GitHub project
+ - string:
+ name: GIT_PROJECT
+ default: "https://github.com/$GITHUB_ORGANIZATION/$PROJECT.git"
+ description: Git URL of the project
+ - string:
+ name: CURRENT_BRANCH
+ default: "master"
+ description: Current Git branch
+ - string:
+ name: DEFAULT_BRANCH
+ default: "master"
+ description: default branch
+ - string:
+ name: MERIDIO_VERSION
+ default: 'latest'
+ description: Version of Meridio
+ - string:
+ name: TAPA_VERSION
+ default: 'latest'
+ description: Version of Meridio TAPA
+ - string:
+ name: KUBERNETES_VERSION
+ default: 'v1.25'
+ description: Version of Kubernetes
+ - string:
+ name: NSM_VERSION
+ default: 'v1.6.0'
+ description: Version of NSM
+ - string:
+ name: IP_FAMILY
+ default: 'dualstack'
+ description: IP Family
+ - string:
+ name: NUMBER_OF_WORKERS
+ default: "2"
+ description: Number of Kubernetes Workers
+ - string:
+ name: ENVIRONMENT_NAME
+ default: "kind-operator"
+ description: Name of the environment (under test/e2e/environment directory in Meridio)
+ - string:
+ name: SKIP
+ default: ""
+ description: e2e tests to skip
+ - string:
+ name: FOCUS
+ default: ""
+ description: e2e tests to focus
+ - string:
+ name: NUMBER_OF_RUNS
+ default: "100"
+ description: Number of e2e runs
+ - string:
+ name: INTERVAL
+ default: "7200"
+ description: Interval between each e2e test run (in seconds)
+ - bool:
+ name: DRY_RUN
+ default: false
+ description: Dry Run
+
+ dsl:
+ !include-raw-escape: e2e-long-run.Jenkinsfile
properties:
- github:
url: https://github.com/Nordix/Meridio-Operator
+ - build-discarder:
+ days-to-keep: 60
+ num-to-keep: 2000
+ artifact-days-to-keep: 60
+ artifact-num-to-keep: 2000
+
parameters:
- string:
stream:
- 'master':
branch: '{stream}'
- jdk-version: java-8
+ jdk-version: java-11
jobs:
- - 'onap-{project-name}-{stream}-verify-java'
\ No newline at end of file
+ - 'onap-{project-name}-{stream}-verify-java'