Skip to content

Commit

Permalink
use BASHUNIT_LOAD_FILE=tests/bootstrap.sh instead of .env.tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Sep 29, 2024
1 parent 3c111e0 commit b4fd8e2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ PR_TICKET_LINK_PREFIX="https://github.com/Chemaclass/create-pr/issues/"
PR_LINK_PREFIX_TEXT="Closes: "
PR_LABEL_MAPPING="docs:documentation; fix|bug|bugfix|hotfix:bug; default:enhancement"

# bashunit
BASHUNIT_DEFAULT_PATH="tests"
BASHUNIT_TESTS_ENV=.env.tests
# lib/bashunit
BASHUNIT_DEFAULT_PATH=tests
BASHUNIT_LOAD_FILE=tests/bootstrap.sh
2 changes: 0 additions & 2 deletions .env.tests

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SRC_SCRIPTS_DIR=src
PRE_COMMIT_SCRIPTS_FILE=./bin/pre-commit

test: $(TEST_SCRIPTS_DIR)
@lib/bashunit tests -e .env.tests
@lib/bashunit tests --load tests/bootstrap.sh

pre_commit/install:
@echo "Installing pre-commit hook"
Expand Down
12 changes: 12 additions & 0 deletions tests/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -euo pipefail

function current_dir() {
dirname "${BASH_SOURCE[1]}"
}

function current_filename() {
basename "${BASH_SOURCE[1]}"
}

export CREATE_PR_ROOT_DIR=.

0 comments on commit b4fd8e2

Please sign in to comment.