So you found a bug, fixed it and would like us to include it in the next release. If so, please read-on.
- Generic docs on github pull requests
- Setting up your machine for testing
- Running tests locally
- Running tests via continuous integration (CI) pipeline
This is how CI pipleine does it.
This CI pipeline can be run locally using https://github.com/nektos/act which will use Docker to run the GitHub Actions workflow.
On your first invocation of act
, select the "Medium" runner image, as the workflow has been tested using that.
Refer to https://github.com/nektos/act#runners for more information.
As it installs many large dependencies, languages and packages, be sure to use act --reuse --job build
to reuse the same container for each invocation.
Here are some notes for ubuntu 20.04
sudo apt install python3 python3-pip python3-pytest tox black pyflakes3
sudo apt install clang-format clang++ libc++-dev libc++abi-dev
- Follow https://rustup.rs/
rustup component add rustfmt
cargo install cargo-script
The following commands will install most of the dependencies on MacOS
brew tap holgerbrandl/tap https://github.com/holgerbrandl/homebrew-tap
brew tap sdkman/tap
brew install astyle clang-format cljstyle flutter gcc go julia kscript ktlint nim sdkman-cli vlang z3
cargo install cargo-script
cljstyle
will refuse to run. In a shell, type open /usr/local/bin/
, locate cljstyle
, and Open.
MacOS will inform that it was downloaded from the Internet and ask for confirmation.
Once confirmed, it will become usable.
alias t=`pytest-3`
t -k cpp -v
Other languages will be similar
pytest-3 -k coverage -v
Most test cases live in <repo>/tests/cases/*.py
and the expected output after
transpilation are in <repo>/tests/expected
. If you make changes to any of the
tests, follow the recipe below and inspect the updated files in tests/expected
.
export UPDATE_EXPECTED=1
t -k changed_tests_filter -v
When tests are run, temporary files are generated, compared against expected golden output and then discarded. If you want to keep them around for debugging purposes, you can use:
export KEEP_EXISTING=1
t -k some_test -v
- Submit your pull request (PR) using the process outlined above
- Navigate to your pull request
- First time committers require their PRs to be approved for CI
- Once approved (automatic on your second PR), you'll see a list of jobs at the bottom of the page. Once all tests pass, your PR is ready to be reviewed for merging.