Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CI): fix test suite and add CI steps #1808

Merged
merged 25 commits into from
Oct 13, 2022
Merged

fix(CI): fix test suite and add CI steps #1808

merged 25 commits into from
Oct 13, 2022

Conversation

joshua-goldstein
Copy link
Contributor

@joshua-goldstein joshua-goldstein commented Oct 12, 2022

Problem

Badger tests are run through a bash script called test.sh. It is currently not working, and there are no CI workflows on the Badger repository.

Solution

We update test.sh and add CI workflow steps. Test suite now works for Linux and Mac (x86, M1). To run the test suite, simply run make test. If you are on Mac, see remark below.

Why a Makefile?

Badger depends on jemalloc for efficient memory allocation (see here, and z package in Ristretto). While Badger can be built without jemalloc, many users will probably want to benefit from it. The makefile makes it easy to install the jemalloc dependency with make jemalloc. Also now the test.sh script contains only test related functionality.

This also has the advantage that now the CI workflow only needs essentially two steps:

make dependency
make test

Remarks

  • In pb/gen.sh, go get is deprecated as a way to retrieve and install an executable into our $GOBIN, which is what we want to do here. We use go install instead.
  • In test.sh, Teamcity flags no longer needed
  • In test.sh, Installjemalloc no longer needed as it is in the Makefile, simplifying the test script
  • In test.sh, tests are now run sequentially and not in parallel (currently broken)
  • We remove .travisci because it is unused
  • Important note for Mac users: for historical reasons, certain tools on MacOS are different from the standard GNU tools everyone else uses. One of these is the mktemp command, which is used in the test suite. In order to get the GNU version of this tool, you can run:
brew install coreutils
export PATH="$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH"
make test

This will temporarily modify your path so that the GNU version of mktemp is called in the script. Without this fix the script will complain that it doesn't recognize the p flag in mktemp -d -p .

To-do

  • tune lint tests
  • add code coverage
  • potentially add build target for badger in makefile
  • bring test suite to parity with old teamcity setup
  • prune dependencies

@skrdgraph
Copy link
Contributor

repoint the merge into from master to main for this PR

@skrdgraph skrdgraph merged commit cd9ddc3 into main Oct 13, 2022
@skrdgraph skrdgraph deleted the joshua/run-ci-jobs branch October 13, 2022 18:51
joshua-goldstein added a commit that referenced this pull request Feb 9, 2023
mangalaman93 pushed a commit that referenced this pull request Feb 11, 2023
mangalaman93 pushed a commit that referenced this pull request Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants