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

Update Linux tests to work on GitHub #6

Merged
merged 21 commits into from
Nov 20, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(Please provide relevant configs (Be sure to remove sensitive info).)

### Steps to Reproduce Issue
(Include debug logs if possible, `bootstrap-salt.sh -D`.)
(Include debug logs if possible, `svtminion.sh --debug`.)

### Versions and Systems
(`salt --versions-report`, `svtminion.sh --version`, system type and version,
Expand Down
27 changes: 7 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

concurrency:
# If changes are pushed to a PR, stop all running workflows before starting new ones
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-bootstrap' && github.run_id || github.ref_name) }}
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-vmtools' && github.run_id || github.ref_name) }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- uses: actions/checkout@v4
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
shellcheck -s bash -f tty linux/svtminion.sh

- name: Set Exit Status
if: always()
Expand All @@ -114,6 +114,7 @@ jobs:
path: exitstatus/



windows-2022:
name: Windows 2022
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
Expand All @@ -127,7 +128,8 @@ jobs:
container-slug: windows-2022
timeout: 20
runs-on: windows-2022
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'
instances: '["3006", "3006-8", "3007", "3007-1"]'



photon-5:
Expand All @@ -142,7 +144,7 @@ jobs:
display-name: Photon OS 5
container-slug: systemd-photon-5
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "latest", "default"]'
instances: '["3006", "3006-8", "3007", "3007-1"]'


rockylinux-9:
Expand All @@ -157,22 +159,8 @@ jobs:
display-name: Rocky Linux 9
container-slug: systemd-rockylinux-9
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'

instances: '["3006", "3006-8", "3007", "3007-1"]'

ubuntu-2204:
name: Ubuntu 22.04
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-linux.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: ubuntu-2204
display-name: Ubuntu 22.04
container-slug: systemd-ubuntu-22.04
timeout: 20
instances: '["stable-3006", "onedir-3006", "stable-3006-8", "stable-3007", "onedir-3007", "stable-3007-1", "git-master", "latest", "default"]'

set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
Expand All @@ -185,7 +173,6 @@ jobs:
- windows-2022
- photon-5
- rockylinux-9
- ubuntu-2204
if: always()
steps:

Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/scripts/cut-release.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,36 +189,36 @@ def main():
)

# Update Script Version for the bash script
bootstrap_script_path = REPO_ROOT / "bootstrap-salt.sh"
svtminion_script_path = REPO_ROOT / "linux/svtminion.sh"
print(
f"* Updating {bootstrap_script_path.relative_to(REPO_ROOT)} ...",
f"* Updating {svtminion_script_path.relative_to(REPO_ROOT)} ...",
file=sys.stderr,
flush=True,
)
bootstrap_script_path.write_text(
svtminion_script_path.write_text(
re.sub(
r'__ScriptVersion="(.*)"',
f'__ScriptVersion="{options.release_tag.lstrip("v")}"',
bootstrap_script_path.read_text(),
svtminion_script_path.read_text(),
)
)

# Update the Script Version for the powershell script
bootstrap_script_path = REPO_ROOT / "bootstrap-salt.ps1"
svtminion_script_path = REPO_ROOT / "windows/svtminion.ps1"
print(
f"* Updating {bootstrap_script_path.relative_to(REPO_ROOT)} ...",
f"* Updating {svtminion_script_path.relative_to(REPO_ROOT)} ...",
file=sys.stderr,
flush=True,
)
bootstrap_script_path.write_text(
svtminion_script_path.write_text(
re.sub(
r'\$__ScriptVersion = "(.*)"',
f'$__ScriptVersion = "{options.release_tag.lstrip("v")}"',
bootstrap_script_path.read_text(),
svtminion_script_path.read_text(),
)
)

parser.exit(status=0, message="CHANGELOG.md and bootstrap-salt.sh updated\n")
parser.exit(status=0, message="CHANGELOG.md and svtminion.sh updated\n")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/templates/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

concurrency:
# If changes are pushed to a PR, stop all running workflows before starting new ones
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-bootstrap' && github.run_id || github.ref_name) }}
group: ${{ github.head_ref || (github.repository == 'saltstack/salt-vmtools' && github.run_id || github.ref_name) }}
cancel-in-progress: true

jobs:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- uses: actions/checkout@v4
- name: ShellCheck
run: |
shellcheck -s sh -f tty bootstrap-salt.sh
shellcheck -s bash -f tty linux/svtminion.sh

- name: Set Exit Status
if: always()
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/templates/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

os.chdir(os.path.abspath(os.path.dirname(__file__)))

## "ubuntu-2204",
LINUX_DISTROS = [
"photon-5",
"rockylinux-9",
"ubuntu-2204",
]

WINDOWS = [
Expand Down Expand Up @@ -43,17 +43,17 @@

LATEST_PKG_BLACKLIST = []

## "ubuntu-2204": "Ubuntu 22.04",
DISTRO_DISPLAY_NAMES = {
"photon-5": "Photon OS 5",
"rockylinux-9": "Rocky Linux 9",
"ubuntu-2204": "Ubuntu 22.04",
"windows-2022": "Windows 2022",
}

## "ubuntu-2204": "systemd-ubuntu-22.04",
CONTAINER_SLUG_NAMES = {
"photon-5": "systemd-photon-5",
"rockylinux-9": "systemd-rockylinux-9",
"ubuntu-2204": "systemd-ubuntu-22.04",
"windows-2022": "windows-2022",
}

Expand Down Expand Up @@ -94,6 +94,9 @@ def generate_test_jobs():
else TIMEOUT_DEFAULT
)

for salt_version in SALT_VERSIONS:
instances.append(salt_version)

if instances:
needs.append(distro)
test_jobs += TEMPLATE.format(
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
## echo "vt parms ,$vt_parms, vt_parms_ver ,$vt_parm_ver,"
## echo "SaltVersion=$vt_parm_ver" >> $GITHUB_ENV

- name: Bootstrap Salt
- name: VMTools Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot
## DGM needs cleanup
Expand All @@ -82,10 +82,9 @@ jobs:
bt_arg1=$(echo "$bt_parms" | awk -F ' ' '{print $1}')
bt_arg2=$(echo "$bt_parms" | awk -F ' ' '{print $2}')
echo "bt parms ,$bt_parms, bt_arg1 ,$bt_arg1, bt_arg2 ,$bt_arg2,"
## DGM sudo sh -x ./bootstrap-salt.sh "$bt_arg1" "$bt_arg2"
bash -x ./linux/svtminion.sh "$bt_arg1" "$bt_arg2"

- name: Test Bootstrap
- name: Test VMTools
run: |
bash -x ./tests/linux/test-linux.sh

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Get Version
run: |
# We need to get the version here and make it an environment variable
# It is used to install via bootstrap and in the test
# It is used to install via svtminion and in the test
# The version is in the instance name
$instance = "${{ matrix.instance }}"
$version = $instance -split "-",2
Expand All @@ -67,11 +67,11 @@ jobs:
}
Write-Output "SaltVersion=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

- name: Bootstrap Salt
- name: VMTools Salt
run: |
. .\bootstrap-salt.ps1 -RunService $false -Version $env:SaltVersion
. .\windows\svtminion.ps1 -RunService $false -Version $env:SaltVersion

- name: Test Bootstrap
- name: Test svtminion
run: |
pytest --cache-clear -v -s -ra --log-cli-level=debug tests/integration/

Expand Down
Loading
Loading