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

Add Python 3.10 to the CI runners #1145

Merged
merged 7 commits into from
Dec 12, 2021
Merged

Conversation

bryanwweber
Copy link
Member

@bryanwweber bryanwweber commented Nov 26, 2021

Changes proposed in this pull request

I decided not to look into #1149 at this time because I suspect that's related to setuptools and how it processes arguments. I think that needs some more discussion in the issue before we try to tackle a fix for it.

Otherwise, I think the changes above are fairly self-explanatory. The only fly in the ointment is the change in coverage, due to using gcovr to collect coverage from the runs, rather than letting CodeCov handle it magically. 🤷 The reason seems to be how branches are counted. Doesn't seem to be much to do, and we only use the coverage metric as a relative number anyways (as in, did it go up or down for a given PR), so the change here is unfortunate but not terrible.

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

As discussed in #1075

@bryanwweber bryanwweber force-pushed the add-py310-to-ci branch 2 times, most recently from 2254673 to fa43093 Compare November 27, 2021 02:49
@codecov
Copy link

codecov bot commented Nov 27, 2021

Codecov Report

Merging #1145 (ff08964) into main (208a89c) will decrease coverage by 7.72%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1145      +/-   ##
==========================================
- Coverage   73.76%   66.04%   -7.73%     
==========================================
  Files         370      313      -57     
  Lines       48984    44939    -4045     
  Branches        0    19107   +19107     
==========================================
- Hits        36134    29679    -6455     
+ Misses      12850    12678     -172     
- Partials        0     2582    +2582     
Impacted Files Coverage Δ
include/cantera/transport/MultiTransport.h 50.00% <0.00%> (-50.00%) ⬇️
include/cantera/base/Units.h 70.00% <0.00%> (-30.00%) ⬇️
include/cantera/base/AnyMap.inl.h 51.85% <0.00%> (-26.90%) ⬇️
include/cantera/kinetics/KineticsFactory.h 73.33% <0.00%> (-26.67%) ⬇️
include/cantera/base/ctexceptions.h 50.00% <0.00%> (-26.20%) ⬇️
src/numerics/ODE_integrators.cpp 50.00% <0.00%> (-25.00%) ⬇️
include/cantera/transport/TransportBase.h 27.02% <0.00%> (-21.59%) ⬇️
include/cantera/thermo/ThermoFactory.h 80.00% <0.00%> (-20.00%) ⬇️
include/cantera/thermo/MolalityVPSSTP.h 80.00% <0.00%> (-20.00%) ⬇️
include/cantera/transport/TransportFactory.h 80.00% <0.00%> (-20.00%) ⬇️
... and 299 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 208a89c...ff08964. Read the comment docs.

@bryanwweber bryanwweber force-pushed the add-py310-to-ci branch 2 times, most recently from 5ea6b06 to a14c4b3 Compare December 7, 2021 00:33
Python 3.10 was released in October 2021, so we need to test for it. To
avoid explosion of the number of jobs, we only test the two most recent
Python releases and the oldest that we support.
The bash uploader is deprecated in favor of the GitHub Action script.
Unfortunately, this means that we have to collect the coverage results
ourselves, and this causes a change in the Codecov reported coverage.
According to several sources online, XCode does not support OMP. This
disables checking for OMP support when Apple's clang (XCode) is being
used.

In addition, the library associated with GCC is called gomp, with LLVM
is called just omp, and with the Intel compiler is called iomp5. SCons
can check for multiple libraries sequentially, stopping when it finds
the first successful case. Due to this, the order of the checks are
important. Presumably, iomp5 and omp will only be installed for their
respective compilers, whereas gomp is likely to be installed for all the
compilers. Thus, gomp must go last in the order. This fixes the CI to
run the OpenMP sample correctly.
@bryanwweber bryanwweber force-pushed the add-py310-to-ci branch 2 times, most recently from af59da7 to 50da94f Compare December 11, 2021 03:08
This is another test for the OpenMP samples.
Older versions of SCons do not support dictionary value-types. Instead,
these must be explicitly cast to lists so that SCons can process all the
files.

Fixes Attribute error during build Cantera#1147
Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

@bryanwweber ... thanks for your work on this!

Most of the updates here look straight-forward, but the coverage is indeed puzzling. Some of the coverage percentages went down significantly (e.g. Units.h, presumably from 100% to 70%). As I'm not familiar with the details, one question I have is whether the new coverage tests include both C++ and Python test suites?

One thing that's conceivable is to split the PR and make a separate PR for the coverage changes, as the rest looks good to me.

@bryanwweber
Copy link
Member Author

As I'm not familiar with the details, one question I have is whether the new coverage tests include both C++ and Python test suites?

It should, or at least, that shouldn't be any different than before. My interpretation of the reason for the difference is that the old Bash Codecov script counted code branches one way (perhaps by ignoring them?) and gcovr counts each if/for/while statement as a separate branch, and not all of them are covered. This is why the "Partials" count in the coverage summary goes from zero to +2500.

One thing that's conceivable is to split the PR and make a separate PR for the coverage changes, as the rest looks good to me.

Any reason for that suggestion? The coverage change will be the same, and this PR doesn't change any files that are counted in the coverage.

@ischoegl
Copy link
Member

ischoegl commented Dec 11, 2021

It should, or at least, that shouldn't be any different than before. My interpretation of the reason for the difference is that the old Bash Codecov script counted code branches one way (perhaps by ignoring them?) and gcovr counts each if/for/while statement as a separate branch, and not all of them are covered. This is why the "Partials" count in the coverage summary goes from zero to +2500.

Good. I'm still wondering what the huge difference is ... the partials only cover about a third of the lines that are now reported as uncovered (i.e. almost 4000 lines are not accounted for by this). One thing that worked in the past is that C++ code could be implicitly covered by Python tests, and it would be pretty bad if this ends up what's happening here. I don't understand enough about gcovr to have a good opinion; at the same time, it's certainly a good idea to move away from something that's cryptic and deprecated.

Any reason for that suggestion? The coverage change will be the same, and this PR doesn't change any files that are counted in the coverage.

The switch to gcovr appears to be a major change of a very important CI job, and blending this together with routine maintenance may not be ideal. If the loss of coverage is 'real', it would be a pretty serious concern; I do understand that, technically, coverage shouldn't change, but some parts that are covered may not be recognized as such that were before.

PS: It appears that the number of lines 'found' by gcovr makes up for the difference (4000+ lines?!), which still doesn't make full sense to me.

@speth
Copy link
Member

speth commented Dec 11, 2021

Good. I'm still wondering what the huge difference is ... the partials only cover about a third of the lines that are now reported as uncovered (i.e. almost 4000 lines are not accounted for by this).

I think these other 4000 lines are the C++ test suite itself, which was previously being counted in the coverage, but is now being excluded. @bryanwweber and I discussed this, and we thought it made sense to exclude the test code itself, because it was a huge source of misleading "partial" coverage, since the branch where each test fails is never run, and worrying about the coverage of the test suite itself seems a bit too meta.

The switch to gcovr appears to be a major change of a very important CI job, and blending this together with routine maintenance may not be ideal. If the loss of coverage is 'real', it would be a pretty serious concern; I do understand that, technically, coverage shouldn't change, but some parts that are covered may not be recognized as such that were before.

I think this is pretty clearly just a difference in what's being reported -- we're running all the same tests as before, so the code that is actually getting run is the same. I don't really see the point of separating this into separate PRs -- the changes to other CI jobs obviously can't affect what happens in the "coverage" job, and I don't see why there would be any concern that the two other changes to the build scripts would affect coverage either.

@ischoegl
Copy link
Member

ischoegl commented Dec 11, 2021

I think these other 4000 lines are the C++ test suite itself, which was previously being counted in the coverage, but is now being excluded.

That makes a lot of sense. If that's all this is, then all's good.

Regarding separating PR's, I saw a possible hangup about coverage, but now that this is clarified my questions are resolved!

Copy link
Member

@ischoegl ischoegl left a comment

Choose a reason for hiding this comment

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

Based on my understanding, this looks good from my side.

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Looks good to me as well.

@speth speth merged commit c7c2082 into Cantera:main Dec 12, 2021
@bryanwweber bryanwweber deleted the add-py310-to-ci branch August 2, 2024 15:14
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.

scons install places some files in wrong location on latest Fedora Linux Attribute error during build
3 participants