Skip to content

Commit

Permalink
Disable powershell test on github
Browse files Browse the repository at this point in the history
  • Loading branch information
MHendricks committed Jan 15, 2024
1 parent ddb3605 commit b048c40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class TestCliExitCodes:
# but is used to ensure that exit-codes are returned to the calling process.
py_cmd = "print('Running...');import sys;print(sys);sys.exit({code})"
output_text = "Running...\n<module 'sys' (built-in)>\n"
run_kwargs = dict(stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=30)
run_kwargs = dict(stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=5)
if sys.version_info.minor >= 7:
run_kwargs["text"] = True
else:
Expand All @@ -235,13 +235,17 @@ def test_bat(self, config_root, exit_code):
assert proc.returncode == exit_code

@pytest.mark.skipif(sys.platform != "win32", reason="only applies on windows")
@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
reason="PowerShell tests timeout when run on github action",
)
@missing_annotations_hack
def test_ps1(self, config_root, exit_code):
# -File is needed to get the exit-code from powershell, and requires a full path
script = (config_root / ".." / "bin" / "hab.ps1").resolve()
# fmt: off
cmd = [
"powershell.exe", "-ExecutionPolicy", "Unrestricted", "-NonInteractive",
"powershell.exe", "-ExecutionPolicy", "Unrestricted",
"-File", str(script),
"--site", str(config_root / "site_main.json"),
*self.sub_cmd,
Expand Down

0 comments on commit b048c40

Please sign in to comment.