Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tests/gpg-flow.bats
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ EOF

# Git repo for setup.sh (needs origin remote)
git -C "$TEST_TMPDIR" init -q
git config --global --add safe.directory "$TEST_TMPDIR"
git -C "$TEST_TMPDIR" remote add origin "git@github.com:test/repo.git"

# SSH key for setup.sh
Expand Down
3 changes: 3 additions & 0 deletions tests/helpers/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ setup_test_env() {

# No pause before an AUR clone or between attempts
export AURTOMATOR_CLONE_DELAY=0 AURTOMATOR_RETRY_DELAY=0

# git reads and writes no global config of the user running the tests
export GIT_CONFIG_GLOBAL="$TEST_TMPDIR/gitconfig"
}

teardown_test_env() {
Expand Down
7 changes: 7 additions & 0 deletions tests/scripts.bats
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ teardown() {
teardown_test_env
}

# === test environment ===

@test "setup_test_env: git keeps its global config in the test directory" {
git config --global --add aurtomator.probe 1
[ "$(git config -f "$TEST_TMPDIR/gitconfig" aurtomator.probe)" = 1 ]
}

# === lib.sh ===

@test "lib.sh: pkg_file resolves existing package" {
Expand Down
1 change: 0 additions & 1 deletion tests/setup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ MOCKEOF

# Init git repo with origin (for secrets step)
git -C "$TEST_TMPDIR" init -q
git config --global --add safe.directory "$TEST_TMPDIR"
git -C "$TEST_TMPDIR" remote add origin "git@github.com:test/repo.git"
}

Expand Down
Loading