Skip to content
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

Unit tests now seem to be broken on MO environment #35

Open
svadams opened this issue Aug 14, 2024 · 4 comments
Open

Unit tests now seem to be broken on MO environment #35

svadams opened this issue Aug 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@svadams
Copy link
Collaborator

svadams commented Aug 14, 2024

As part of investigations for #34 I checked out the latest copy of this repo to run the unit tests on MO VDI/Spice and I get errors when running python -m unittest xios_examples.read_axis_resample.test_resample_cases. Full stack trace in comments below.

@svadams
Copy link
Collaborator Author

svadams commented Aug 14, 2024

tagging @mo-marqh @TeranIvy @harry-shepherd for info

@svadams svadams added the bug Something isn't working label Aug 14, 2024
@svadams
Copy link
Collaborator Author

svadams commented Aug 14, 2024

Stack trace:

Traceback (most recent call last):
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/__main__.py", line 18, in <module>
    main(module=None)
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/main.py", line 147, in parseArgs
    self.createTests()
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/main.py", line 159, in createTests
    self.module)
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/net/project/ukmo/scitools/opt_scitools/environments/production/2021_07_26/lib/python3.7/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/net/data/users/sadams/tcd-XIOS-demonstration/xios_examples/read_axis_resample/test_resample_cases.py", line 10, in <module>
    import xios_examples.shared_testing as xshared
  File "/net/data/users/sadams/tcd-XIOS-demonstration/xios_examples/shared_testing.py", line 10, in <module>
    import xios_examples.gen_netcdf as gn
  File "/net/data/users/sadams/tcd-XIOS-demonstration/xios_examples/gen_netcdf.py", line 6, in <module>
    from .dataFunc import dataFunc
  File "/net/data/users/sadams/tcd-XIOS-demonstration/xios_examples/dataFunc.py", line 123
    if hasattr(self, do) and callable(func := getattr(self, do)):
                                           ^
SyntaxError: invalid syntax

@mo-marqh
Copy link
Member

the := syntax was introduced in Python 3.8
https://docs.python.org/3/whatsnew/3.8.html#assignment-expressions

the stack trace you provided @svadams states it's using Python 3.7 which is a fairly old version.
the default in Scitools is currently 3.11.7
the github runner uses Python 3.10

please may you try running this with a more recent version of Python?

@mo-marqh
Copy link
Member

mo-marqh commented Nov 7, 2024

i understand that moving to a newer Python is slightly tricky on the environment in question
also, this Env may become obsolete soon.

#36 partially fixes this issue, by bypassing this failure in python syntax, which leads to a few test failures, but is better than current

once #36 is on, we can look at a better skip pattern for the environment in question, that will enable most tests to be run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants