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

General cleanup of tests, SCons building, and submodules #803

Merged
merged 13 commits into from
Jun 11, 2020

Conversation

bryanwweber
Copy link
Member

@bryanwweber bryanwweber commented Feb 10, 2020

Checklist

  • There is a clear use-case for this code change
  • The commit message has a short title & references relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • The pull request is ready for review

Changes proposed in this pull request

  • Fix a few conversion script tests that were loading the wrong files
  • Have SConstruct check instRoot instead of env['prefix'] to see if this is the source directory

This branch is rebased on top of #796 so I can continue to use it to test the Conda packages

@bryanwweber bryanwweber changed the title Fix python tests Fix conversion tests & building Conda MATLAB package Feb 10, 2020
@codecov
Copy link

codecov bot commented Feb 10, 2020

Codecov Report

Merging #803 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #803   +/-   ##
=======================================
  Coverage   71.57%   71.57%           
=======================================
  Files         372      372           
  Lines       44501    44501           
=======================================
  Hits        31851    31851           
  Misses      12650    12650           
Impacted Files Coverage Δ
src/equil/vcs_solve_TP.cpp 68.47% <ø> (ø)

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 4b9adfa...6a320ee. Read the comment docs.

@speth
Copy link
Member

speth commented Mar 26, 2020

Can you rebase this on current master and fix the merge conflicts?

@bryanwweber
Copy link
Member Author

@speth Done!

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.

I see the logic of fully specifying the path to the newly-converted input file, but I'm a little confused by a couple of things here.

First, what's wrong with loading the reference file from the Cantera data path? This is presumably what's making it necessary to add another copy of gri30.xml to that location?

Second, doesn't this logic also apply to the other sets of tests in test_convert.py, i.e. cti2yamlTest and ctml2yamlTest. Right now, this PR is affects the ck2cti and ck2yaml tests. And in that case, we definitely wouldn't want to have to copy all of the reference files that are currently in the common data directory to test/data.

@bryanwweber
Copy link
Member Author

bryanwweber commented May 3, 2020

First, what's wrong with loading the reference file from the Cantera data path? This is presumably what's making it necessary to add another copy of gri30.xml to that location?

If I recall correctly, the reason I added the test data directory explicitly was to avoid loading a file with the same name from the data directory. It may have been the liquidvapor.yaml file, which is now fixed by #826. I'm going to temporarily comment out the change there and see if the test failures return in the Conda recipe.

Second, doesn't this logic also apply to the other sets of tests in test_convert.py, i.e. cti2yamlTest and ctml2yamlTest. Right now, this PR is affects the ck2cti and ck2yaml tests.

Yes, I was trying to limit the fix to the one that would solve the problem I was having.

And in that case, we definitely wouldn't want to have to copy all of the reference files that are currently in the common data directory to test/data

Eventually, those files are going to go away, at least my understanding of the plan is that we're going to stop distributing all CTI and XML files with 3.0. So they will have to be copied at some point. I think the change to that line can be deferred until that happens.

@bryanwweber bryanwweber changed the title Fix conversion tests & building Conda MATLAB package General cleanup of tests and submodules May 27, 2020
@bryanwweber bryanwweber changed the title General cleanup of tests and submodules General cleanup of tests, SCons building, and submodules May 27, 2020
@speth
Copy link
Member

speth commented Jun 5, 2020

I'm not able to compile the version of Googletest introduced in this PR branch using MSVC 14.0 (aka Visual Studio 2015). I get the following error:

cl.exe /Fobuild\ext\googletest\googletest\src\gtest-all.obj /c ext\googletest\googletest\src\gtest-all.cc /EHsc /MD /nologo /D_SCL_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_WARNINGS /O2 /Zi /Fdbuild\ext\googletest\googletest\src\gtest-all.obj.pdb /DGTEST_HAS_PTHREAD=0 /DNDEBUG /Iext\googletest\googletest /Iext\googletest\googletest\include /IC:\src\boost_1_71_0
gtest-all.cc
C:\src\cantera\ext\googletest\googletest\include\gtest/internal/gtest-internal.h(1188): error C2039: 'FlatTupleBase<testing::internal::FlatTuple<bool,bool>,testing::internal::IndexSequence<0,1> >': is not a member of 'testing::internal::FlatTuple<bool,bool>'
C:\src\cantera\ext\googletest\googletest\include\gtest/internal/gtest-param-util.h(747): note: see reference to class template instantiation 'testing::internal::FlatTuple<bool,bool>' being compiled
C:\src\cantera\ext\googletest\googletest\include\gtest/gtest-param-test.h(360): note: see reference to class template instantiation 'testing::internal::ValueArray<bool,bool>' being compiled

I haven't been able to find anything searching for this error, and I'm not sure what versions of MSVC this version of Googletest is meant to support.

@bryanwweber
Copy link
Member Author

Interestingly, the builds pass with MSVC 14.0 on the Windows GitHub actions builds: https://github.com/Cantera/cantera/pull/775/checks?check_run_id=713201352 Those have VS 2019 with the 14.0 build tools installed.

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.

Most of this seems fine to me, except I think there is a better solution to the issue of compiler intermediates that aren't being cleaned up.

I pushed an alternative commit that fixes this for more compilers and without requiring additional arguments to the test cases to my version of this branch (https://github.com/speth/cantera/commits/fix-python-tests), along with a commit refactoring of how the classes used for building these test cases. I can push these changes to this PR branch if you want to consider them as a friendly amendment.

Comment on lines 114 to 116
yaml = ("phases:\n- name: gas\n elements: [C, H]\n "
"species: [dummy-thermo.yaml/species: [R1A, R1B, P1]]\n "
"thermo: ideal-gas")
Copy link
Member

Choose a reason for hiding this comment

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

This might be a good place to use the YAML flow style.

Also, the elements declaration is almost never required in YAML.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! I included elements since the CTI test did as well 🤷‍♂️

@bryanwweber
Copy link
Member Author

@speth Thanks! Feel free to push the changes for the test file cleanup.

The YAML test was still loading the CTI file
The original test file was checking the conversion of a file
not related to this test.
Ensures that all converted files are loaded from the work directory and
all reference files are loaded from the test/data directory.

This fixes a test failure due to an incorrectly explicitly specified CTI
file extension.
Since the staging directory can be set when the prefix is the current
directory, the install should be able to continue in that case.
Resolves errors when compling the VCS solver related to incomplete
type specifications
SUNDIALS: 5.1 -> 5.3
Eigen: 3.3.4 -> 3.3.7
Google Test: 1.8.0 -> 1.10
fmt: 6.1.2 -> 6.2.1
fmtlib v6.2.0 and 6.2.1 changed their includes so that windows.h is
included without defining NOMINMAX. This caused the max macro from
windows.h to collide with the function from the stdlib leading to an
error from the ValueCache.h header.
The previous check was too specific for the output of --version and did
not work with Clang 11.0. I hope that Xcode being somewhere in the
output will be more stable than the output starting with Apple LLVM. I
checked the output of Clang installed with Homebrew and it did not
include Xcode anywhere in it.
The MATLAB docs files are no longer in the code-docs folder.
speth added 2 commits June 9, 2020 21:47
Some of the build files in the test_problems folder were not being
cleaned by scons test-clean. This seems to be because they were not the
same name as the executable.
- Use more standard approach to handling constructor kwargs
- Provide default values for additional arguments
- Integrate handling of programs used for multiple tests
@speth speth merged commit ac11e7c into Cantera:master Jun 11, 2020
@bryanwweber
Copy link
Member Author

Thanks @speth!

bryanwweber added a commit to speth/cantera that referenced this pull request Jun 19, 2020
The changes from Cantera#803 regarding explicitly specifying the converted
output file didn't get included when this test was added in Cantera#822.
speth pushed a commit that referenced this pull request Jun 19, 2020
The changes from #803 regarding explicitly specifying the converted
output file didn't get included when this test was added in #822.
12Chao pushed a commit to 12Chao/cantera that referenced this pull request Jul 1, 2020
The changes from Cantera#803 regarding explicitly specifying the converted
output file didn't get included when this test was added in Cantera#822.
srikanthallu pushed a commit to srikanthallu/cantera that referenced this pull request Sep 17, 2020
The changes from Cantera#803 regarding explicitly specifying the converted
output file didn't get included when this test was added in Cantera#822.
@bryanwweber bryanwweber deleted the fix-python-tests branch January 30, 2021 02:26
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