Changed the way tests were handling `git-commit`. Since CI was failing.

Changed it to set `user.name` and `user.email`.
pull/27/head
sobolevn 8 years ago
parent 92be14c232
commit b176040a83

@ -14,7 +14,6 @@ TEST_SECRETS_DIR="$BATS_TMPDIR/$SECRETS_DIR"
TEST_SECRETS_DIR_PATHS_MAPPING="$BATS_TMPDIR/$SECRETS_DIR_PATHS_MAPPING" TEST_SECRETS_DIR_PATHS_MAPPING="$BATS_TMPDIR/$SECRETS_DIR_PATHS_MAPPING"
TEST_GPG_HOMEDIR="$PWD" TEST_GPG_HOMEDIR="$PWD"
# TEST_TEMP_FILE="$BATS_TMPDIR/test_temp"
# GPG-based stuff: # GPG-based stuff:
: ${SECRETS_GPG_COMMAND:="gpg"} : ${SECRETS_GPG_COMMAND:="gpg"}
@ -22,6 +21,7 @@ GPGTEST="$SECRETS_GPG_COMMAND --homedir=$TEST_GPG_HOMEDIR --no-permission-warnin
# Personal data: # Personal data:
TEST_DEFAULT_USER="user1" TEST_DEFAULT_USER="user1"
function test_user_password { function test_user_password {
@ -34,7 +34,6 @@ function test_user_email {
} }
# GPG: # GPG:
function _get_gpg_fingerprint_by_email { function _get_gpg_fingerprint_by_email {
@ -103,6 +102,7 @@ function uninstall_fixture_full_key {
# Git: # Git:
function git_set_config_email { function git_set_config_email {
git config --local user.email "$1" git config --local user.email "$1"
} }
@ -113,12 +113,22 @@ function git_restore_default_email {
} }
function git_commit {
git_set_config_email "$1"
git config --local user.name "Your Name"
git add --all
git commit -m "$2"
}
function remove_git_repository { function remove_git_repository {
rm -rf ".git" rm -rf ".git"
} }
# Git Secret: # Git Secret:
function set_state_git { function set_state_git {
git init > /dev/null 2>&1 git init > /dev/null 2>&1
} }

@ -48,8 +48,7 @@ function teardown {
@test "run 'changes' with commit" { @test "run 'changes' with commit" {
git add --all git_commit "$(test_user_email $TEST_DEFAULT_USER)" 'initial'
git commit -m 'initial'
local password=$(test_user_password "$TEST_DEFAULT_USER") local password=$(test_user_password "$TEST_DEFAULT_USER")
echo "new content" >> "$FILE_TO_HIDE" echo "new content" >> "$FILE_TO_HIDE"

@ -4,7 +4,7 @@ load _test_base
function setup { function setup {
install_fixture_key $TEST_DEFAULT_USER install_fixture_key "$TEST_DEFAULT_USER"
set_state_git set_state_git
set_state_secret_init set_state_secret_init
} }

Loading…
Cancel
Save