Skip to content

Commit

Permalink
Add some debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy committed Nov 4, 2024
1 parent 6c5647c commit cecd11e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 303 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
separator: ","
files: |
bootstrap-salt.*
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
files_ignore: |
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/templates/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
separator: ","
files: |
bootstrap-salt.*
Gemfile
kitchen*.yml
tests/**
.github/workflows/**
files_ignore: |
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,14 @@ jobs:
run: |
. .\bootstrap-salt.ps1 -RunService $false
- name: Add Salt to Path
- name: Set Environment Variables
run: |
$env:Path = "$env:Path;C:\Program Files\Salt Project\Salt"
$env:Instance = "${{ matrix.instance }}"
Write-Output "Path:"
Write-Output $env:Path
Write-Output "Environment Variables"
Get-ChildItem Env:
- name: Test Bootstrap
run: |
Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,3 @@ venv

# Pycharm
.idea

# test-kitchen
.kitchen.local.yml
kitchen.local.yml
.kitchen/
.bundle/
11 changes: 0 additions & 11 deletions Gemfile

This file was deleted.

119 changes: 0 additions & 119 deletions Vagrantfile

This file was deleted.

158 changes: 0 additions & 158 deletions kitchen.yml

This file was deleted.

25 changes: 21 additions & 4 deletions tests/integration/test_installation.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
import json
import logging
import os
import platform
import subprocess
import json

import pytest
from Demos.win32cred_demo import target

log = logging.getLogger(__name__)


@pytest.fixture
def path():
if platform.system() == "Windows":
salt_path = "C:\\Program Files\\Salt Project\\Salt"
if salt_path not in os.environ["path"]:
os.environ["path"] = f'{os.environ["path"]};{salt_path}'
yield os.environ["path"]


def run_salt_call(cmd):
"""
Runs salt call command and returns a dictionary
Expand All @@ -16,21 +30,24 @@ def run_salt_call(cmd):
return json_data["local"]


def test_ping():
def test_ping(path):
cmd = ["salt-call", "--local", "test.ping"]
result = run_salt_call(cmd)
path = os.getenv("path")
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'}
Expand Down

0 comments on commit cecd11e

Please sign in to comment.