Added debugging and setting test version as github environment variable

This commit is contained in:
David Murphy 2024-11-12 10:59:50 -07:00
parent 736e8c0bc3
commit f52fea9e1d
No known key found for this signature in database
GPG key ID: 9D7724F37A7424D8
5 changed files with 53 additions and 2 deletions

View file

@ -61,6 +61,19 @@ jobs:
echo "DGM plain pip for distro-slug ${{ inputs.distro-slug }}"
python3 -m pip install -r tests/requirements.txt
- 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
# The version is in the instance name
# sed 1st - becomes space, 2nd - becomes dot
echo "matrix instance ,${{ matrix.instance }},"
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
vt_parm_ver=$(echo "$vt_parms2" | awk -F ' ' '{print $2}')
echo "bt parms ,$vt_parms, vt_parms2 ,$vt_parms2, vt_parms_ver ,$vt_parm_ver,"
echo ""SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot

View file

@ -51,6 +51,19 @@ jobs:
run: |
python3 -m pip install -r tests/requirements.txt
- 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
# The version is in the instance name
# sed 1st - becomes space, 2nd - becomes dot
echo "matrix instance ,${{ matrix.instance }},"
vt_parms=$(echo "${{ matrix.instance }}" | sed 's/-/ /')
vt_parms2=$(echo "$vt_parms" | sed 's/-/./')
vt_parm_ver=$(echo "$vt_parms2" | awk -F ' ' '{print $2}')
echo "bt parms ,$vt_parms, vt_parms2 ,$vt_parms2, vt_parms_ver ,$vt_parm_ver,"
echo ""SaltVersion=$vt_parm_ver" >> $GITHUB_ENV
- name: Bootstrap Salt
run: |
# sed 1st - becomes space, 2nd - becomes dot

View file

@ -618,7 +618,9 @@ __check_services_systemd_functional
# Define installation type
if [ "$#" -gt 0 ];then
__check_unparsed_options "$*"
ITYPE=$1
## DGM ITYPE=$1
# get first arguement
ITYPE=$(echo $1 | awk -F ' ' '{print $1}')
shift
fi

View file

@ -19,6 +19,11 @@ def target_salt_version():
target_salt = os.environ.get("SaltVersion", "")
print(
f"DGM conftest target_salt_version, target_salt '{target_salt}', os.environ '{os.environ}'",
flush=True,
)
html_response = requests.get(API_URL)
content = json.loads(html_response.text)
folders = content["children"]
@ -32,10 +37,23 @@ def target_salt_version():
versions[maj_version] = version
versions["latest"] = version
print(
f"DGM conftest target_salt_version, target_salt '{target_salt}', versions '{versions}'",
flush=True,
)
if target_salt.startswith("v"):
target_salt = target_salt[1:]
if target_salt not in versions:
pytest.skip(f"Invalid testing version: {target_salt}")
if target_salt in ("default", "latest", "master", "nightly"):
if target_salt in (
"default",
"latest",
"master",
"nightly",
"stable",
"onedir",
"git",
):
pytest.skip("Don't have a specific salt version to test against")
return versions[target_salt]

View file

@ -74,5 +74,10 @@ def test_target_salt_version(path, target_salt_version):
pytest.skip(f"No target version specified")
cmd = ["salt-call", "--local", "grains.item", "saltversion", "--timeout=120"]
result = run_salt_call(cmd)
dgm_saltversion = result["saltversion"]
print(
f"DGM test_target_salt_version, target_salt_version '{target_salt_version}', result saltversion '{dgm_saltversion }', result '{result}'",
flush=True,
)
# Returns: {'saltversion': '3006.9+217.g53cfa53040'}
assert result["saltversion"] == target_salt_version