Show HN: We built a tool for fast-forwarding 95% of tests (MIT) (github.com)
Hi, we are working on a tool for speeding up test runs, by skipping tests unaffected by code changes.
Effectivly, Saving 80-95% of the time, by skipping 80-95% of tests.
We started a few months ago, and have managed to get into a few production CI systems. All our prospects and users are on holiday right now. So we decided to repackage and open-source for local test running. available here (https://github.com/nabaz-io/nabaz) under MIT license.
One line change: pytest -v -> nabaz test --cmdline "pytest -v"
Stalk us on GitHub, or just Star us. Ask questions, we'll answer in under 30 seconds. we have auto refresh on.
17 comments
[ 4.5 ms ] story [ 60.7 ms ] threadthey 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 ex-Google employee who came out with something similar in 2005 for JUnit java tests, since erased it was called google-testar.
We talked to him and ulitmatly he sunsetted the project because:
1) static analysis back then was basically copying language parser code from the Language distro and retro fitting it which was HARD to maintain.
2) Misses when resource files were changed, he was a one man show to my understanding.
Our View: Static analysis has gone a long way since... and yet no one has made something for system tests and integration tests, there's a couple unit tests solution out there.
See: https://static.googleusercontent.com/media/research.google.c...
https://research.facebook.com/publications/predictive-test-s...
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 mark those tests as always run, hopefully you are testing your codebase and not just thirdparty integrations.
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.
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 :)
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.