-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7b3b396
commit eb2ca4f
Showing
6 changed files
with
47 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: "Bats test" | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
integration: | ||
name: Bats tests | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Nix | ||
uses: DeterminateSystems/nix-installer-action@v4 | ||
- name: Run the Magic Nix Cache | ||
uses: DeterminateSystems/magic-nix-cache-action@v2 | ||
- name: Buck2 build | ||
run: nix develop -c buck2 build core/api core/api-keys apps/dashboard apps/consent | ||
- name: Run bats tests | ||
run: | | ||
nix develop -c bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
export REPO_ROOT=$(git rev-parse --show-toplevel) | ||
source "${REPO_ROOT}/bats/helpers/setup-and-teardown.bash" | ||
|
||
TILT_PID_FILE=$REPO_ROOT/bats/.tilt_pid | ||
|
||
setup_suite() { | ||
background buck2 run //dev:up -- --bats=True > "${REPO_ROOT}/bats/.e2e-tilt.log" | ||
echo $! > "$TILT_PID_FILE" | ||
await_api_is_up | ||
} | ||
|
||
teardown_suite() { | ||
if [[ -f "$TILT_PID_FILE" ]]; then | ||
kill "$(cat "$TILT_PID_FILE")" > /dev/null || true | ||
fi | ||
|
||
buck2 run //dev:down | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters