diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1cd83bb53f341bdcb0a557d7acd5fbda2c05355..2eaa8f046605cd89b906a95bf1ce2e6a1436273d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,10 +11,6 @@ variables: GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray' ANSIBLE_FORCE_COLOR: "true" MAGIC: "ci check this" - TEST_ID: "$CI_PIPELINE_ID-$CI_JOB_ID" - CI_TEST_VARS: "./tests/files/${CI_JOB_NAME}.yml" - CI_TEST_REGISTRY_MIRROR: "./tests/common/_docker_hub_registry_mirror.yml" - CI_TEST_SETTING: "./tests/common/_kubespray_test_settings.yml" GS_ACCESS_KEY_ID: $GS_KEY GS_SECRET_ACCESS_KEY: $GS_SECRET CONTAINER_ENGINE: docker diff --git a/tests/Makefile b/tests/Makefile index 50256b197d61c045aea388f036080adfdf79527d..33e0e9dcb63019c1fbc1c34b1797c66208c265d1 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -13,7 +13,7 @@ create-packet: init-packet ansible-playbook cloud_playbooks/create-packet.yml -c local \ $(ANSIBLE_LOG_LEVEL) \ -e @"files/${CI_JOB_NAME}.yml" \ - -e test_id=$(TEST_ID) \ + -e test_name="$(subst .,-,$(CI_PIPELINE_ID)-$(CI_JOB_ID))" \ -e branch="$(CI_COMMIT_BRANCH)" \ -e pipeline_id="$(CI_PIPELINE_ID)" \ -e inventory_path=$(INVENTORY_DIR) diff --git a/tests/cloud_playbooks/create-packet.yml b/tests/cloud_playbooks/create-packet.yml index 2cd08b54d18dde857197f1091062d9b96fa82ec0..26c39217f1e013356b245c36dc5a736cf24da497 100644 --- a/tests/cloud_playbooks/create-packet.yml +++ b/tests/cloud_playbooks/create-packet.yml @@ -4,8 +4,5 @@ hosts: localhost gather_facts: false become: true - vars: - ci_job_name: "{{ lookup('env', 'CI_JOB_NAME') }}" - test_name: "{{ test_id | regex_replace('\\.', '-') }}" roles: - { role: packet-ci, vm_cleanup: false } diff --git a/tests/common/_kubespray_test_settings.yml b/tests/common/_kubespray_test_settings.yml deleted file mode 100644 index 67da05c50e2cb6afda6b834bbdcaf83cbb7394cd..0000000000000000000000000000000000000000 --- a/tests/common/_kubespray_test_settings.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# Kubespray settings for tests -deploy_netchecker: true -dns_min_replicas: 1 -unsafe_show_logs: true diff --git a/tests/common/_docker_hub_registry_mirror.yml b/tests/common_vars.yml similarity index 95% rename from tests/common/_docker_hub_registry_mirror.yml rename to tests/common_vars.yml index 8875d217338d50cd35d49520ecb140f46102fbd9..a8645ba26bf917d6d1435403c9bfeb06fac21e26 100644 --- a/tests/common/_docker_hub_registry_mirror.yml +++ b/tests/common_vars.yml @@ -1,4 +1,10 @@ --- +# Kubespray settings for tests +deploy_netchecker: true +dns_min_replicas: 1 +unsafe_show_logs: true + +# Registry mirrors settings docker_registry_mirrors: - "https://mirror.gcr.io" @@ -34,7 +40,3 @@ nginx_image_repo: "{{ quay_image_repo }}/kubespray/nginx" flannel_image_repo: "{{ quay_image_repo }}/kubespray/flannel" flannel_init_image_repo: "{{ quay_image_repo }}/kubespray/flannel-cni-plugin" - -# Kubespray settings for tests -deploy_netchecker: true -dns_min_replicas: 1 diff --git a/tests/scripts/testcases_run.sh b/tests/scripts/testcases_run.sh index 6235d2ed348f71e97b11182f5058caf8d4715451..81632eeee1d387932aa324da7c97e09db162aefd 100755 --- a/tests/scripts/testcases_run.sh +++ b/tests/scripts/testcases_run.sh @@ -18,10 +18,9 @@ fi # Check out latest tag if testing upgrade if [ "${UPGRADE_TEST}" != "false" ]; then git fetch --all && git checkout "$KUBESPRAY_VERSION" - # Checkout the CI vars file so it is available - git checkout "${CI_COMMIT_SHA}" tests/files/${CI_JOB_NAME}.yml - git checkout "${CI_COMMIT_SHA}" ${CI_TEST_REGISTRY_MIRROR} - git checkout "${CI_COMMIT_SHA}" ${CI_TEST_SETTING} + # Checkout the current tests/ directory ; even when testing old version, + # we want the up-to-date test setup/provisionning + git checkout "${CI_COMMIT_SHA}" -- tests/ fi # needed for ara not to complain @@ -57,9 +56,8 @@ shift # We can set --limit here and still pass it as supplemental args because `--limit` is a 'last one wins' option ansible-playbook \ $ANSIBLE_LOG_LEVEL \ - -e @${CI_TEST_SETTING} \ - -e @${CI_TEST_REGISTRY_MIRROR} \ - -e @${CI_TEST_VARS} \ + -e @tests/common_vars.yml \ + -e @tests/files/${CI_JOB_NAME}.yml \ -e local_release_dir=${PWD}/downloads \ "$@" \ ${playbook}