-
Notifications
You must be signed in to change notification settings - Fork 85
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
ci: Add simplified CI for Windows #2363
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2363 +/- ##
=======================================
Coverage 98.28% 98.28%
=======================================
Files 69 69
Lines 4539 4539
Branches 803 803
=======================================
Hits 4461 4461
Misses 45 45
Partials 33 33
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
what's broken on windows here? It could just be a missing path. |
There we multiple errors but here's an example of one ================================== FAILURES ===================================
___________________ test_import_prepHistFactory[inprocess] ____________________
E FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json'
All traceback entries are hidden. Pass `--full-trace` to see hidden and internal frames.
During handling of the above exception, another exception occurred:
tmpdir = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0')
script_runner = <ScriptRunner inprocess>
def test_import_prepHistFactory(tmpdir, script_runner):
temp = tmpdir.join("parsed_output.json")
command = f'pyhf xml2json validation/xmlimport_input/config/example.xml --basedir validation/xmlimport_input/ --output-file {temp.strpath:s} --hide-progress'
ret = script_runner.run(shlex.split(command))
assert ret.success
assert ret.stdout == ''
assert ret.stderr == ''
> parsed_xml = json.loads(temp.read())
command = 'pyhf xml2json validation/xmlimport_input/config/example.xml --basedir validation/xmlimport_input/ --output-file C:\\U...ata\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json --hide-progress'
ret = <pytest_console_scripts.RunResult object at 0x000002E66E873C40>
script_runner = <ScriptRunner inprocess>
temp = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json')
tmpdir = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0')
tests\test_scripts.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\_pytest\_py\path.py:377: in read
with self.open(mode) as f:
mode = 'r'
self = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json')
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json')
mode = 'r', ensure = False, encoding = None
def open(self, mode="r", ensure=False, encoding=None):
"""Return an opened file with the given mode.
If ensure is True, create parent directories if needed.
"""
if ensure:
self.dirpath().ensure(dir=1)
if encoding:
return error.checked_call(io.open, self.strpath, mode, encoding=encoding)
> return error.checked_call(open, self.strpath, mode)
E py.error.ENOENT: [No such file or directory]: open('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json', 'r')
encoding = None
ensure = False
mode = 'r'
self = local('C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_import_prepHistFactory_in0\\parsed_output.json')
C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\site-packages\_pytest\_py\path.py:[76](https://github.com/scikit-hep/pyhf/actions/runs/6635684924/job/18027015790#step:6:77)1: ENOENT
---------------------------- Captured stdout call -----------------------------
# Running console script: ['pyhf', 'xml2json', 'validation/xmlimport_input/config/example.xml', '--basedir', 'validation/xmlimport_input/', '--output-file', 'C:UsersrunneradminAppDataLocalTemppytest-of-runneradminpytest-0test_import_prepHistFactory_in0parsed_output.json', '--hide-progress']
# Script return code: 0
# Script stdout:
# Script stderr: |
command = f'pyhf xml2json validation/xmlimport_input/config/example.xml --basedir validation/xmlimport_input/ --output-file {temp.strpath:s} --hide-progress'
ret = script_runner.run(shlex.split(command)) Paths have backslashes on windows, which worries me a bit there, and https://docs.python.org/3/library/shlex.html#shlex.split says that |
To make things compatible with Windows this is going to require some work, so I'm going to merge this in and then we can fix up the test suite in a follow up PR.
Thanks and noted. From the pytest docs (https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html#the-tmpdir-and-tmpdir-factory-fixtures):
We'll fix this up in another PR. 👍
Looking at an example: Lines 60 to 70 in 6203a8f
Internally import os
shlex.split(command, posix=os.name == 'posix') |
Description
Resolves #2358
Add simplified CI for Windows. The workflow doesn't run on push or pull request events as it is slow but instead runs on a nightly schedule job and on demand with workflow dispatch. The workflow runs the normal test suite with the exception that it skips
tests/test_scripts.py
as these are currently broken on Windows. Python 3.8 is not added to the test matrix as there is no Python 3.8 version ofjaxlib
.As this effectively adds testing support for Windows, additionally add operating system dependent PyPI trove classifiers.
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: