Skip to content

Commit

Permalink
Update tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Nov 7, 2024
1 parent aef73e4 commit de5f8d4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 72 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,6 @@ jobs:
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'



windows-2019:
name: Windows 2019
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
uses: ./.github/workflows/test-windows.yml
needs:
- lint
- generate-actions-workflow
with:
distro-slug: windows-2019
display-name: Windows 2019
timeout: 20
runs-on: windows-2019
instances: '["stable-3006", "stable-3006-8", "stable-3007", "stable-3007-1", "latest"]'


windows-2022:
name: Windows 2022
if: github.event_name == 'push' || needs.collect-changed-files.outputs.run-tests == 'true'
Expand Down Expand Up @@ -480,7 +464,6 @@ jobs:
- generate-actions-workflow
- macos-12
- macos-13
- windows-2019
- windows-2022
- almalinux-8
- almalinux-9
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"ubuntu-2404",
]
WINDOWS = [
"windows-2019",
"windows-2022",
]

Expand Down Expand Up @@ -265,7 +264,6 @@
"ubuntu-2404": "Ubuntu 24.04",
"macos-12": "macOS 12",
"macos-13": "macOS 13",
"windows-2019": "Windows 2019",
"windows-2022": "Windows 2022",
}

Expand Down
1 change: 0 additions & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
steps:
- uses: actions/checkout@v4


- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
Expand Down
42 changes: 0 additions & 42 deletions kitchen.windows.yml

This file was deleted.

19 changes: 9 additions & 10 deletions tests/integration/test_installation.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import json
import logging
import os
import platform
import subprocess

import pytest

## from Demos.win32cred_demo import target

log = logging.getLogger(__name__)


Expand All @@ -26,28 +25,28 @@ def run_salt_call(cmd):
"""
cmd.append("--out=json")
result = subprocess.run(cmd, capture_output=True, text=True)
if result.stdout:
json_data = json.loads(result.stdout)
return json_data["local"]
return None
json_data = json.loads(result.stdout)
return json_data["local"]


def test_ping():
def test_ping(path):
cmd = ["salt-call", "--local", "test.ping"]
result = run_salt_call(cmd)
assert result == True


def test_target_python_version(target_python_version):
def test_target_python_version(path, target_python_version):
cmd = ["salt-call", "--local", "grains.item", "pythonversion", "--timeout=120"]
result = run_salt_call(cmd)
# Returns: {'pythonversion': [3, 10, 11, 'final', 0]}
py_maj_ver = result["pythonversion"][0]
assert py_maj_ver == target_python_version


def test_target_salt_version(target_salt_version):
def test_target_salt_version(path, target_salt_version):
if not target_salt_version:
pytest.skip(f"No target version specified")
cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"]
result = run_salt_call(cmd)
# Returns: {'saltversion': '3006.9+217.g53cfa53040'}
assert result["saltversion"] == target_salt_version
assert result["saltversion"] == target_salt_version
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
requests

0 comments on commit de5f8d4

Please sign in to comment.