Fixing defaults (#1921)

* Fixing a bug when no type or version is specified.  Adding tests for when no type or version is passed.

* skip test_installation when using default type as we do not have a version to compare.

* adding rockylinux-9 and centos-stream9 to stable distros.

* adding rockylinux-9 and centos-stream9 to stable distros.

* Adding debugging for BSDs.

* Update Vagrant.

* Use upgrade instead of install to ensure vagrant is upgraded.

* cleanup code adding default type.

* better cleanup for default bootstrap type.
This commit is contained in:
Gareth J. Greenaway 2023-04-26 10:30:40 -07:00 committed by GitHub
parent 28b82ea761
commit f457cc3dcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 32 deletions

View file

@ -249,7 +249,7 @@ jobs:
distro-slug: almalinux-8
display-name: AlmaLinux 8
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
almalinux-9:
@ -263,7 +263,7 @@ jobs:
distro-slug: almalinux-9
display-name: AlmaLinux 9
timeout: 20
instances: '["git-3005", "onedir-3005", "onedir-3006", "git-master", "latest"]'
instances: '["git-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
amazon-2:
@ -277,7 +277,7 @@ jobs:
distro-slug: amazon-2
display-name: Amazon 2
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
arch:
@ -291,7 +291,7 @@ jobs:
distro-slug: arch
display-name: Arch
timeout: 20
instances: '["git-master", "latest"]'
instances: '["git-master", "latest", "default"]'
centos-7:
@ -305,7 +305,7 @@ jobs:
distro-slug: centos-7
display-name: CentOS 7
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
centos-stream8:
@ -319,7 +319,7 @@ jobs:
distro-slug: centos-stream8
display-name: CentOS Stream 8
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
centos-stream9:
@ -333,7 +333,7 @@ jobs:
distro-slug: centos-stream9
display-name: CentOS Stream 9
timeout: 20
instances: '["git-3005", "onedir-3005", "onedir-3006", "git-master", "latest"]'
instances: '["git-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
debian-10:
@ -347,7 +347,7 @@ jobs:
distro-slug: debian-10
display-name: Debian 10
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
debian-11:
@ -361,7 +361,7 @@ jobs:
distro-slug: debian-11
display-name: Debian 11
timeout: 20
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
fedora-36:
@ -375,7 +375,7 @@ jobs:
distro-slug: fedora-36
display-name: Fedora 36
timeout: 20
instances: '["stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3006", "onedir-3006", "git-master", "latest", "default"]'
fedora-37:
@ -389,7 +389,7 @@ jobs:
distro-slug: fedora-37
display-name: Fedora 37
timeout: 20
instances: '["stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3006", "onedir-3006", "latest", "default"]'
fedora-38:
@ -403,7 +403,7 @@ jobs:
distro-slug: fedora-38
display-name: Fedora 38
timeout: 20
instances: '["stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3006", "onedir-3006", "latest", "default"]'
gentoo:
@ -417,7 +417,7 @@ jobs:
distro-slug: gentoo
display-name: Gentoo
timeout: 90
instances: '["git-master", "latest"]'
instances: '["git-master", "latest", "default"]'
gentoo-systemd:
@ -431,7 +431,7 @@ jobs:
distro-slug: gentoo-systemd
display-name: Gentoo (systemd)
timeout: 90
instances: '["git-master", "latest"]'
instances: '["git-master", "latest", "default"]'
opensuse-15:
@ -445,7 +445,7 @@ jobs:
distro-slug: opensuse-15
display-name: Opensuse 15
timeout: 20
instances: '["latest"]'
instances: '["latest", "default"]'
opensuse-tumbleweed:
@ -459,7 +459,7 @@ jobs:
distro-slug: opensuse-tumbleweed
display-name: Opensuse Tumbleweed
timeout: 20
instances: '["git-master", "latest"]'
instances: '["git-master", "latest", "default"]'
oraclelinux-7:
@ -473,7 +473,7 @@ jobs:
distro-slug: oraclelinux-7
display-name: Oracle Linux 7
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
oraclelinux-8:
@ -487,7 +487,7 @@ jobs:
distro-slug: oraclelinux-8
display-name: Oracle Linux 8
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
photon-3:
@ -501,7 +501,7 @@ jobs:
distro-slug: photon-3
display-name: Photon OS 3
timeout: 20
instances: '["stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3006", "onedir-3006", "git-master", "latest", "default"]'
photon-4:
@ -515,7 +515,7 @@ jobs:
distro-slug: photon-4
display-name: Photon OS 4
timeout: 20
instances: '["stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3006", "onedir-3006", "git-master", "latest", "default"]'
rockylinux-8:
@ -529,7 +529,7 @@ jobs:
distro-slug: rockylinux-8
display-name: Rocky Linux 8
timeout: 20
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest"]'
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "latest", "default"]'
rockylinux-9:
@ -543,7 +543,7 @@ jobs:
distro-slug: rockylinux-9
display-name: Rocky Linux 9
timeout: 20
instances: '["git-3005", "onedir-3005", "onedir-3006", "git-master", "latest"]'
instances: '["git-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
ubuntu-2004:
@ -557,7 +557,7 @@ jobs:
distro-slug: ubuntu-2004
display-name: Ubuntu 20.04
timeout: 20
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3003", "stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
ubuntu-2204:
@ -571,7 +571,7 @@ jobs:
distro-slug: ubuntu-2204
display-name: Ubuntu 22.04
timeout: 20
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest"]'
instances: '["stable-3004", "stable-3005", "onedir-3005", "stable-3006", "onedir-3006", "git-master", "latest", "default"]'
set-pipeline-exit-status:

View file

@ -50,10 +50,12 @@ BSD = [
STABLE_DISTROS = [
"almalinux-8",
"almalinux-9",
"amazon-2",
"arch",
"centos-7",
"centos-stream8",
"centos-stream9",
"debian-10",
"debian-11",
"fedora-36",
@ -68,6 +70,7 @@ STABLE_DISTROS = [
"photon-3",
"photon-4",
"rockylinux-8",
"rockylinux-9",
"ubuntu-2004",
"ubuntu-2204",
]
@ -172,7 +175,9 @@ BLACKLIST_3004 = [
]
BLACKLIST_3005 = [
"almalinux-9",
"arch",
"centos-stream9",
"fedora-36",
"fedora-37",
"fedora-38",
@ -182,6 +187,7 @@ BLACKLIST_3005 = [
"opensuse-tumbleweed",
"photon-3",
"photon-4",
"rockylinux-9",
]
BLACKLIST_GIT_3004 = [
@ -482,6 +488,11 @@ def generate_test_jobs():
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
for bootstrap_type in ("default",):
if distro not in STABLE_DISTROS:
continue
instances.append(bootstrap_type)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
@ -522,6 +533,11 @@ def generate_test_jobs():
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
for bootstrap_type in ("default",):
if distro not in STABLE_DISTROS:
continue
instances.append(bootstrap_type)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
@ -613,6 +629,11 @@ def generate_test_jobs():
kitchen_target = f"{bootstrap_type}-{salt_version}"
instances.append(kitchen_target)
for bootstrap_type in ("default",):
if distro not in STABLE_DISTROS:
continue
instances.append(bootstrap_type)
if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(

View file

@ -51,6 +51,11 @@ jobs:
ruby-version: 2.6.10
bundler-cache: true
- name: Update Vagrant
run: |
brew update
brew upgrade vagrant
- name: Setup Vagrant Cache
uses: actions/cache@v3
with:

View file

@ -617,7 +617,7 @@ if [ "$ITYPE" = "git" ]; then
elif [ "$ITYPE" = "stable" ]; then
if [ "$#" -eq 0 ];then
ONEDIR_REV="latest"
_ONEDIR_REV="$1"
_ONEDIR_REV="latest"
ITYPE="onedir"
else
if [ "$(echo "$1" | grep -E '^(nightly|latest|3006)$')" != "" ]; then
@ -1860,12 +1860,6 @@ else
fi
fi
# Red Hat variants after 9.x not supported by stable type
if [ "$(echo "${DISTRO_NAME_L}" | grep -E '(centos|red_hat|scientific|almalinux|rocky)')" != "" ] && [ "$ITYPE" = "stable" ] && [ "$DISTRO_MAJOR_VERSION" -ge 9 ]; then
echoerror "${DISTRO_NAME} ${DISTRO_VERSION} not supported by stable type, use type onedir."
exit 1
fi
# For Ubuntu derivatives, pretend to be their Ubuntu base version
__ubuntu_derivatives_translation

View file

@ -311,6 +311,11 @@ suites:
salt_version: latest
salt_bootstrap_options: -MP stable %s
- name: default
provisioner:
salt_version: latest
salt_bootstrap_options: -MP
- name: onedir-nightly
provisioner:
salt_version: nightly

View file

@ -50,6 +50,6 @@ def target_salt_version():
target_salt = os.environ["KITCHEN_SUITE"].split("-", 2)[-1].replace("-", ".")
if target_salt.startswith("v"):
target_salt = target_salt[1:]
if target_salt in ("latest", "master", "nightly"):
if target_salt in ("default", "latest", "master", "nightly"):
pytest.skip("Don't have a specific salt version to test against")
return target_salt