Skip to content

Conversation

@pp-mo
Copy link
Member

@pp-mo pp-mo commented Feb 7, 2021

🚀 Pull Request

Description

To enable easier debugging of test failures.

It's complicated because, since adoption of nox, the testing environment is built with a combination of pip and conda.


Consult Iris pull request check list


# Always echo the env content for CI test failure debugging.
session.install("beautifultable")
session.run("python", "tools/env_listing.py")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pp-mo Personally, I'd opt to add the following 3 line conda_script in .cirrus-ci instead:

#
# YAML alias for common linux test infra-structure.
#
linux_task_template: &LINUX_TASK_TEMPLATE
  auto_cancellation: true
  ...
  nox_cache:
     ...
  conda_script:
    - conda list --name base
    - conda list --name base --explicit
    - conda info

Copy link
Member

@bjlittle bjlittle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pp-mo Lovely work... but I don't think this is necessary, unless I've misunderstood.

Adding my suggested conda_script to the .cirrus-ci would align this with the output from the retired .travis-ci

@pp-mo pp-mo requested a review from trexfeathers February 7, 2021 23:01
@pp-mo
Copy link
Member Author

pp-mo commented Feb 7, 2021

Well I did try adding "conda list" first, but I found a lot of the packages were missing, apparently because nox has installed them via pip instead ?
So, I put that just in the 'tests' function, where the 'env_listing' now is.

If you look at the outputs in the test logs, those with the source "pip" (rather than "conda" or "both") are not present in the "conda list" output.
Am I missing something here -- is it different if you add it in the common template, for some reason I'm not getting ?

@pp-mo
Copy link
Member Author

pp-mo commented Feb 7, 2021

P.S. the original problem for which I introduced this was a failure to check out on python 3.7 in the latest merge to master :
(i.e. 3ff15a6, from merge of #3980)

The message was like this...

...
======================================================================
FAIL: test_self_referencing_load_issue_3367 (iris.tests.integration.test_netcdf.TestSelfReferencingVarLoad)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/cirrus-ci-build/lib/iris/tests/integration/test_netcdf.py", line 405, in test_self_referencing_load_issue_3367
    warn.assert_called_with(expected_msg)
  File "/tmp/cirrus-ci-build/.nox/tests/lib/python3.7/unittest/mock.py", line 878, in assert_called_with
    raise AssertionError(_error_message()) from cause
AssertionError: Expected call: warn("Missing CF-netCDF measure variable 'areacello', referenced by netCDF variable 'volcello'")
Actual call: warn('`np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.\nDeprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations', <class 'DeprecationWarning'>, stacklevel=2)
----------------------------------------------------------------------
Ran 5040 tests in 127.803s
FAILED (SKIP=22, failures=1)
nox > Command python -m iris.tests.runner --default-tests --system-tests failed with exit code 1
nox > Session tests failed.

So, I really thought that looked like a solid logical problem, possibly to do with a changed numpy version, and not a glitch.
But since I re-spun the Cirrus tests, the problem vanished. 😬

@pp-mo
Copy link
Member Author

pp-mo commented Feb 7, 2021

@bjlittle I'd opt to add the following 3 line conda_script in .cirrus-ci instead ...

Just trying that #3986 ..

@bjlittle
Copy link
Member

bjlittle commented Feb 9, 2021

@pp-mo Could we close this in preference for #3990 ?

What do you think?

@pp-mo
Copy link
Member Author

pp-mo commented Feb 9, 2021

Could we close this in preference for #3990 ?
Absolutely. You fixed it !

@pp-mo pp-mo closed this Feb 9, 2021
@pp-mo pp-mo deleted the ci_conda_list branch April 28, 2023 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants