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

Tests failing on bash 4.4 #86

Open
dserodio opened this issue Jul 4, 2018 · 2 comments
Open

Tests failing on bash 4.4 #86

dserodio opened this issue Jul 4, 2018 · 2 comments
Labels
aged Issues that have gone more than 365 days without a response from the requester.

Comments

@dserodio
Copy link

dserodio commented Jul 4, 2018

I just downloaded git-secrets via git (commit b296988), ran make test and 3 tests fail:

  • Rejects commits with prohibited patterns in changeset
  • Scans staged files
  • Rejects commits with prohibited patterns in changeset when AWS provider is enabled

Details:

$ bash --version | head -1
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

$ grep --version | head -1
grep (GNU grep) 3.1

$ make test 
test/bats/bin/bats test/
 ✓ Rejects commit messages with prohibited patterns
 ✓ Allows commit messages that do not match a prohibited pattern
 ✓ no arguments prints usage instructions
 ✓ -h prints help
 ✓ Invalid scan filename fails
 ✓ Does not require secrets
 ✓ No prohibited matches exits 0
 ✓ Scans all files when no file provided
 ✓ Scans all files including history
 ✓ Scans all files when no file provided with secret in history
 ✓ Scans all files including history with secret in history
 ✓ Scans history with secrets distributed among branches in history
 ✓ Scans recursively
 ✓ Scans recursively only if -r is given
 ✓ Excludes allowed patterns from failures
 ✓ Prohibited matches exits 1
 ✓ Only matches on word boundaries
 ✓ Can scan from stdin using -
 ✓ installs hooks for repo
 ✓ fails if hook exists and no -f
 ✓ Overwrites hooks if -f is given
 ✓ installs hooks for repo with Debian style directories
 ✓ installs hooks to template directory
 ✓ Scans using keys from credentials file
 ✓ Lists secrets for a repo
 ✓ Adds secrets to a repo and de-dedupes
 ✓ Adds allowed patterns to a repo and de-dedupes
 ✓ Empty lines must be ignored in .gitallowed files
 ✓ Comment lines must be ignored in .gitallowed files
 ✓ Scans all files and allowing none of the bad patterns in .gitallowed
 ✓ Scans all files and allowing all bad patterns in .gitallowed
 ✓ Adds common AWS patterns
 ✓ Adds providers
 ✓ Strips providers that return nothing
 ✓ --recursive cannot be used with SCAN_*
 ✓ --recursive can be used with --scan
 ✓ --recursive can't be used with --list
 ✓ -f can only be used with --install
 ✓ -a can only be used with --add
 ✓ -l can only be used with --add
 ✓ --cached can only be used with --scan
 ✓ --no-index can only be used with --scan
 ✓ --untracked can only be used with --scan
 ✗ Rejects commits with prohibited patterns in changeset
   (in test file test/pre-commit.bats, line 9)
     `[ $status -eq 1 ]' failed
   Initialized empty Git repository in /tmp/test-repo/.git/
   /home/dserodio/code/git-secrets
   /tmp/test-repo
   /tmp/test-repo
 ✓ Rejects commits with prohibited patterns in changeset with filename that contain spaces
 ✗ Scans staged files
   (in test file test/pre-commit.bats, line 32)
     `[ $status -eq 1 ]' failed
   Initialized empty Git repository in /tmp/test-repo/.git/
   /home/dserodio/code/git-secrets
   /tmp/test-repo
 ✓ Allows commits that do not match prohibited patterns
 ✗ Rejects commits with prohibited patterns in changeset when AWS provider is enabled
   (in test file test/pre-commit.bats, line 56)
     `[ $status -eq 1 ]' failed
   Initialized empty Git repository in /tmp/test-repo/.git/
   /home/dserodio/code/git-secrets
   /tmp/test-repo
   /tmp/test-repo
   /tmp/test-repo
 ✓ Rejects merges with prohibited patterns in history
 ✓ Allows merges that do not match prohibited patterns

50 tests, 3 failures
Makefile:12: recipe for target 'test' failed
make: *** [test] Error 1
@vikten22
Copy link

can anyone answer this?

@mtdowling
Copy link
Contributor

Are the tests still failing for you using 1.3.0 of git-secrets?

@plygrnd plygrnd added the aged Issues that have gone more than 365 days without a response from the requester. label May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aged Issues that have gone more than 365 days without a response from the requester.
Projects
None yet
Development

No branches or pull requests

4 participants