-
Notifications
You must be signed in to change notification settings - Fork 31
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
Testflo update #36
Testflo update #36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few general comments
- I personally would prefer a single reference file rather than one for serial and one for parallel, since some values are the same. This can also make it more explicit if the serial/parallel values do not mach when they are expected to match. However, I'm not sure exactly how to implement this for training, since you would have incomplete information when you train with just serial tests for example. Maybe we should shelf this and make it an enhancement in the
BaseRegTest
class. What do others think about this? - Regarding the
AttributeError
during training, is this the same problem that @joanibal ran into for ADflow? What exactly is causing this problem? I wonder if there is a way to handle this without using the hacky solution - How do you plan to add the complex tests? will it be a separate file, or will you use the conditional import approach? i.e. import either
idwarp
oridwarp_cs
based on the test.
Now for the specific TODOs:
- Yes I believe that is a typo that should be fixed
- Unfortunately I don't believe
verifyWarpDeriv
will return the status of the check, so there is no way to fail the test if this fails. It's possible to fix this to return a status from the Fortran layer, but it will require work. Again, I would say this is an optional enhancement but maybe document this in a general "Testing enhancement" issue for future reference - If we are okay with updating the reference values once in a while, we could remove the default options and just use what's in IDWarp. Maybe for stability reasons we may not want that, I don't feel strongly about this so I'll let others chime in.
Why do the parallel test give such different values for "sum of dxs"? |
Regarding the attribute error. In the adflow tests the train method checks if the class has a name attribute before training since parameterized adds a name attribute to the derived classes. |
I believe the old tests also had different values for |
Using the |
Hmm. I can't think of a good reason why those value should be that different. @eirikurj, @friedenhe, and or @camader , Is it expected that the derivative values for |
|
I agree more refactoring would be nice but is not necessary for this PR. When point 3, the complexified tests, is addressed I'll give this PR the green light. |
Firstly, why did you update the refs? Secondly, some comments on the complex tests. The way you have it set up now will run all tests together, which is a problem since you are stuck with a single PETSc architecture for a single run. So, there are two solutions here:
|
I updated the tests because I did not re-train them after I fixed the bug. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @marcomangano for updating the tests. I can verify that now both real and complex tests run, and the skipTest
is working as expected.
@joanibal this is something we may want to do for other repos that have complex tests. A single test command testflo .
will run real tests, and if the complex library exists, run the complex tests as well. We may want to generalize this further by defining a decorator that does this in BaseRegTest
.
Purpose
As per title, this PR updates the testing infrastructure to use
testflo
.I used a simplified
parameterized
approach fromADflow
to run single core and parallel tests using the same runfile (but different.ref
files!)I also did my best to comment the code, but I am not 100% confident about the tests themselves, it looks they are stretching a few different kind of meshes.
Closes #33
Type of change
Testing
I cross checked the values with the
.ref
files in the old format, they matchChecklist
flake8
andblack
to make sure the code adheres to PEP-8 and is consistently formatted