Show HN: Skip tests unaffected by code change.
https://github.com/nabaz-io/nabaz
Hi, we're Yuval and Roey. We are working on nabaz A CI/CD plugin that runs only the tests affected by a code change by looking at the code covered by each test. Skipping 80-95% of tests.We started a few months ago, and have managed to get into a few production CI systems here in Israel. (startups only for now).
All our prospects and users are on holiday RN lol, October is a series of jewish holidays, the entire business-month doesn't exist, at least for scheduling meetings.
Scared of our progress halting completely for the whole month
we decided to repackage our CI/CD solution for dev local use, and open-source it.
Our test runner is available on GitHub (https://github.com/nabaz-io/nabaz) under MIT license.
Give us feedback. Stalk us on GitHub, or just Star us.
We encourage you to ask questions, we’ll both be here answering them.
Yuval and Roey from Israel. לילה טוב ומנב"ז
(
17 comments
| 2 points
| on HN
)
they are pretty much flawed in a way, because they require you to wait weeks/months to gain statistical sagnificance. And even then they are too costly to train to make sense in smaller scales.
There's an old ex-Google employee who came out with something similar in 2005 for JUnit java tests. We talked to him and ulitmatly he sunsetted the project because static analysis back then was basically copying language parser code from the Language distro and retro fitting it.
Static analysis has gone a long way since though... and no one has yet to deploy something that works for system tests and integration tests in this strategy.
1. Collects code coverage for every tests that runs, seperatly.
2. Saves code coverage in local sqlite db, along with commit ID as key.
Second to n runs later:
1. Traverse git tree and queries db via commit ID -> per test code coverage
2.a git diff between new code (code change) and the code coverage from the old commit, test case by test case.
2.b. If an intersection between new code and old code coverage is found, test is rerun. else, it will be skipped.
Depends on the what you define by "externality".
I like to look at it this way, what's being tested? I see three groups:
I'm telling you our current plan, feel free to poke holes:In the first case the only externalities that seem to really matter are mostly resource and configuration files. We could detect I/O with such files and rerun the test if the underlying resource/config changed.
In the second case were planning on collecting coverage for all services being tested and then employ a more sophisticated diff heurastic.
For the third case you can mark the test as always run
We have a poc of a syscall tracer that gives us an I/O map of the test being run or the software being tested. this includes reading/writing to files, pipes, network etc...
What are the odds this baby will be made compatible with Java?
However they are usually testing components from end-to-end. This seems not very amenable to benefitting this approach, since "side effects" are an inherent part of nearly every integration test.
Regarding side effects, completely fine as long as they're mapped out. Would love to hear more, nothing pitchy or salesy.
hmu [email protected]
Would love to know more about your use case, email is somewhere in the comments
About the env vars: yes. We have a list of edge cases that might affect the tests. Env vars specifically is the next edge case we are about to cover.
Roey from nabaz.
We took all notes to heart, the main problem we identified that currently (at this stage of the product cycle we don't yet support all edge cases)
And this hurts usability and value, will figure out a way to deliver this kind of tech in a way that is still valuable at this early stage :)
Yuval
Let's assume you have a function:
let's assume you changed func3 only, or func2, but during the run of the test only func1 ran.The test will be skipped because no change could of affected it's result. NOT in gta.