Our Testing needs attention #762
Replies: 4 comments 1 reply
-
@Brennan1994 it has been on my mind, too. Thanks for starting this discussion. Setting up more mock objects sounds like a great idea for our unit and integration tests. Is there a procedure you'd recommend for some manual testing to make sure we're importing and reading files correctly? |
Beta Was this translation helpful? Give feedback.
-
https://stackoverflow.com/questions/1408175/execute-unit-tests-serially-rather-than-in-parallel describes how to make Xunit run tests sequentially rather than parallel. That would remove our issues with test failing due to file access things for the files we have in the repo. Some combination of this and more thoughtfully separating test classes is probably what we need. If we could get all the file loading things to be a single, separate test class, we could load up super simple datasets, just complex enough to prove they load, and then migrate all other classes to using mock data. Any test classes that are meant to benchmark/test real world datasets should only be separate from the ones that just confirm behavior. And the data for those classes should be hosted somewhere (like devnet drive), where we can manually download and place in a specified location on our machines to run the tests. There's also a way to add a little widget to our front page that would put the status of our integration tests front and center. Might drive more attention toward them. I've seen it on other repos. I'll need to investigate how to make that happen for us, but I think that might be useful. That's a lot of babble. Trying to boil down a level...
|
Beta Was this translation helpful? Give feedback.
-
I did some investigation. I have findings and recommendations.
My recommendations (implemented on branch refactor/testOrganization):
These changes are reflected on PR769 #769 |
Beta Was this translation helpful? Give feedback.
-
Sounds good. Let's do it. @Brennan1994 would you mind updating our contributing guide to reflect that? |
Beta Was this translation helpful? Give feedback.
-
There's an issue with our testing framework, and we're getting bit by it too often for my tastes.
I'm working through some failing tests in InventoryShould.cs today that are results of edits made over the last couple months that I suspect weren't caught because when we ran the tests on the pull requests on github, the green check came back. Trouble is InventoryShould.cs is full of disk tests that don't run on GitHub, so we missed it.
This happens the same with integration tests. Those do actually run on Github weekly, but the results are hidden from the main page, so we never pay attention to them.
I'm thinking moving forward we may want to do more mock data things like I did with hydraulics. I see huge value in unit tests that serve as a gatekeeper to merging a pull request, and drastically less value in integration tests which run once a week that nobody looks at, and even less in disk tests that we only run on our machines for development.
I have ideas to make this better I'll record here. I just wanted to start this discussion while it was fresh in my head. Also open to other opinions and ideas.
Beta Was this translation helpful? Give feedback.
All reactions