Replies: 1 comment
-
|
Converted this idea into issue #25 where dev refactoring will be done. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem: Consistency between developer run tests v/s those run in CI.
Build-and-test tests run by developers are manual, and can sometimes go out-of-sync with tests run in CI jobs, implemented in
build.yml. While adding new changes to this repo, one has to frequently go through multiple manualmakeexecutions and verify the outputs.Some of these commands are duplicted in the
runmethods in CI's build.ymlThis will eventually create friction when developers "think" their tests are complete, but CI jobs fail due to some other modes of test-execution.
Solution: Refactor test.sh into code that can be shared by build.yml rules.
I would like to start refactoring nascent test-code chunks in test.sh so that they can be directly re-used by the actions in
build.ymlrun under CI.The idea is that each test-case in
test.shis refactored into a small function, which will be called underbuild.ymlby invokingtest.shwith that named test-case-function.An example will be a function named
build-and-run-unit-tests()intest.shand this will be invoked through CI as something like:test.shinto a collection of small "test-do-this" methods.$ ./test.shwhich will run through all these test-methods on their dev-boxbuild.ymlwill be a series ofrunmethods invoking each such test-method.$ ./test.sh build-and-run-c-samplesThis way, developers can be sure that everything that needs to be built and tested in CI is also tested on their own dev boxes before submitting a PR for CI jobs.
Reference:
This exact same approach was implemented in the Certifier Framework oss project, after months of struggling with this dev-vs-CI inconsistency issue.
See test.sh and their build.yml for a reference implementation of how this turned out.
For example, a test-call in
build.ymlwill look like:Where the matching test-code in
test.shis a function named exactly like thename:above:This approach is basically stitching bunches of simple Bash scripting together into something that can be used reliably.
This technique has been used successfully in that other project.
Overview of features:
cleanup()method has been implemented which robustly checks for non-zero$rcfrom command failures--listspits out the list-of-tests that can be run.--helpis also supported.I would like to replicate that approach in this project.
If there are better ways to do this kind of dev-test-CI integration, I'm happy to hear about it.
Beta Was this translation helpful? Give feedback.
All reactions