Running ABAP unit tests on GitHub Actions
Ideally, unit tests are fast and only run the code in a single unit, ie. dependencies are mocked.
This makes unit tests great for CI, but there is no easy way to spawn a new ABAP system for each commit(?).
But what if we go one step further and mock the ABAP system?
It’s a bit more work, a bit more difficult, but fun 🙂
Using GitHub actions is free for public projects, and very useful when the changes can come from anywhere(untrusted).
I’ve prepared a sample repository, which can be cloned, and is open to test pull requests:
The Actions workflow is configured so the unit tests runs for each commit,
Real Continuous Integration
Note how this is a real Continuous Integration setup, unit tests are run for each push for every developer, this setup is running 300+ unit tests for abapGit in 18 seconds, giving fast feedback to the developer.
It might give false positives, but please see it as a step running before involving a real system(Scenario 9).
If you would like to try it out, start early, and start with the basics of your application.
Keep strict track of all dependencies, abaplint can help with this.
If the code use 702+ syntax, an extra downport step must be added to the compilation.
And expect a lot of bugs 😀 as always, bug reports are welcome on GitHub.