git-secret icon indicating copy to clipboard operation
git-secret copied to clipboard

fix tests on windows using msys2

Open joshrabinowitz opened this issue 2 years ago • 0 comments

We were testing with this in .github/workflows/test.yml:

  windows-msys2-ci:
    runs-on: windows-latest 
    steps:
    - uses: msys2/setup-msys2@v2
      with:
        msystem: mingw64
        update: true
        install: >-
          base-devel
          git man make 
    - uses: actions/checkout@v3
    - name: Run checks
      run: make test
      env:
        SECRETS_DOCKER_ENV: windows
        SECRETS_TEST_VERBOSE: 1

I think the test failures are because we are not property stopping gpg-agent between test runs on cygwin or msys2, see https://github.com/sobolevn/git-secret/issues/376 and https://github.com/sobolevn/git-secret/issues/406

Most tests pass, but these fail like this:

 ✗ run 'reveal' with wrong password
   (in test file /home/joshr/git-secret/tests/test_reveal.bats, line 168)
     `[ "$status" -eq 2 ]' failed
         PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
        8903       1    8903       6240  ?         197608 21:02:14 /usr/bin/gpg-agent
       56143    8676    8650       7780  pty0      197608 21:42:07 /usr/bin/bash
        8678    8669    8650       6176  pty0      197608 21:02:05 /usr/bin/bash
       62985   56143    8650       6244  pty0      197608 21:49:04 /usr/bin/bash
       63608   62985    8650       4932  pty0      197608 21:49:36 /usr/bin/ps
        8650     111    8650       4624  pty0      197608 21:02:04 /usr/bin/make
       48293       1   48293       5848  ?         197608 21:35:30 /usr/bin/mintty
        8669    8668    8650       5324  pty0      197608 21:02:05 /usr/bin/bash
        8664    8650    8650       7012  pty0      197608 21:02:04 /usr/bin/bash
       48297   48293   48297       5700  pty1      197608 21:35:31 /usr/bin/bash
        2314       1    2314       3628  ?         197608 20:23:01 /usr/bin/gpg-agent
         110       1     110       7100  ?         197608 19:52:49 /usr/bin/mintty
        8676    8669    8650       4276  pty0      197608 21:02:05 /usr/bin/bash
         210       1     210        684  ?         197608 19:54:18 /usr/bin/gpg-agent
         111     110     111       3136  pty0      197608 19:52:50 /usr/bin/bash
       63219       1   63219       4968  ?         197608 21:49:17 /usr/bin/gpg-agent
        8677    8669    8650       3684  pty0      197608 21:02:05 /usr/bin/bash
        8668    8664    8650       7148  pty0      197608 21:02:05 /usr/bin/bash
   ps: unknown option -- w
   Try `ps --help' for more information.


 ✗ run 'reveal' for attacker
   (in test file /home/joshr/git-secret/tests/test_reveal.bats, line 183)
     `[ "$status" -eq 2 ]' failed
         PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
        8903       1    8903       6240  ?         197608 21:02:14 /usr/bin/gpg-agent
       56143    8676    8650       7780  pty0      197608 21:42:07 /usr/bin/bash
        8678    8669    8650       6176  pty0      197608 21:02:05 /usr/bin/bash
        8650     111    8650       4624  pty0      197608 21:02:04 /usr/bin/make
       48293       1   48293       5848  ?         197608 21:35:30 /usr/bin/mintty
        8669    8668    8650       5324  pty0      197608 21:02:05 /usr/bin/bash
        8664    8650    8650       7012  pty0      197608 21:02:04 /usr/bin/bash
       48297   48293   48297       5700  pty1      197608 21:35:31 /usr/bin/bash
        2314       1    2314       3628  ?         197608 20:23:01 /usr/bin/gpg-agent
       63632   56143    8650       7796  pty0      197608 21:49:37 /usr/bin/bash
         110       1     110       7100  ?         197608 19:52:49 /usr/bin/mintty
        8676    8669    8650       4276  pty0      197608 21:02:05 /usr/bin/bash
         210       1     210        684  ?         197608 19:54:18 /usr/bin/gpg-agent
         111     110     111       3136  pty0      197608 19:52:50 /usr/bin/bash
        8677    8669    8650       3684  pty0      197608 21:02:05 /usr/bin/bash
       63866       1   63866       1172  ?         197608 21:49:48 /usr/bin/gpg-agent
       64270   63632    8650       2180  pty0      197608 21:50:08 /usr/bin/ps
        8668    8664    8650       7148  pty0      197608 21:02:05 /usr/bin/bash
   ps: unknown option -- w
   Try `ps --help' for more information.
 ✗ run 'reveal' for attacker with -F (force)
   (in test file /home/joshr/git-secret/tests/test_reveal.bats, line 204)
     `[ ! -f "$FILE_TO_HIDE" ]' failed
         PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
        8903       1    8903       6240  ?         197608 21:02:14 /usr/bin/gpg-agent
       64294   56143    8650       7172  pty0      197608 21:50:09 /usr/bin/bash
       56143    8676    8650       7780  pty0      197608 21:42:07 /usr/bin/bash
        8678    8669    8650       6176  pty0      197608 21:02:05 /usr/bin/bash
        8650     111    8650       4624  pty0      197608 21:02:04 /usr/bin/make
       48293       1   48293       5848  ?         197608 21:35:30 /usr/bin/mintty
        8669    8668    8650       5324  pty0      197608 21:02:05 /usr/bin/bash
        8664    8650    8650       7012  pty0      197608 21:02:04 /usr/bin/bash
       48297   48293   48297       5700  pty1      197608 21:35:31 /usr/bin/bash
        2314       1    2314       3628  ?         197608 20:23:01 /usr/bin/gpg-agent
       64528       1   64528        412  ?         197608 21:50:20 /usr/bin/gpg-agent
         110       1     110       7100  ?         197608 19:52:49 /usr/bin/mintty
        8676    8669    8650       4276  pty0      197608 21:02:05 /usr/bin/bash
         210       1     210        684  ?         197608 19:54:18 /usr/bin/gpg-agent
       64932   64294    8650       4664  pty0      197608 21:50:44 /usr/bin/ps
         111     110     111       3136  pty0      197608 19:52:50 /usr/bin/bash
        8677    8669    8650       3684  pty0      197608 21:02:05 /usr/bin/bash
        8668    8664    8650       7148  pty0      197608 21:02:05 /usr/bin/bash
   ps: unknown option -- w
   Try `ps --help' for more information.
 ✓ run 'reveal' for multiple users (with key deletion)
 ✓ run 'reveal' for multiple users (normally)
 ✓ run 'reveal' with SECRETS_PINENTRY=loopback
 ✗ run 'reveal' with SECRETS_PINENTRY=error
   (in test file /home/joshr/git-secret/tests/test_reveal.bats, line 276)
     `[ "$status" -ne 0 ]' failed
         PID    PPID    PGID     WINPID   TTY         UID    STIME COMMAND
        8903       1    8903       6240  ?         197608 21:02:14 /usr/bin/gpg-agent
       56143    8676    8650       7780  pty0      197608 21:42:07 /usr/bin/bash
        8678    8669    8650       6176  pty0      197608 21:02:05 /usr/bin/bash
        2509    1882    8650       5860  pty0      197608 21:53:35 /usr/bin/ps
        8650     111    8650       4624  pty0      197608 21:02:04 /usr/bin/make
       48293       1   48293       5848  ?         197608 21:35:30 /usr/bin/mintty
        8669    8668    8650       5324  pty0      197608 21:02:05 /usr/bin/bash
        8664    8650    8650       7012  pty0      197608 21:02:04 /usr/bin/bash
        2116       1    2116       4340  ?         197608 21:53:14 /usr/bin/gpg-agent
       48297   48293   48297       5700  pty1      197608 21:35:31 /usr/bin/bash
        2314       1    2314       3628  ?         197608 20:23:01 /usr/bin/gpg-agent
         110       1     110       7100  ?         197608 19:52:49 /usr/bin/mintty
        8676    8669    8650       4276  pty0      197608 21:02:05 /usr/bin/bash
         210       1     210        684  ?         197608 19:54:18 /usr/bin/gpg-agent
         111     110     111       3136  pty0      197608 19:52:50 /usr/bin/bash
        8677    8669    8650       3684  pty0      197608 21:02:05 /usr/bin/bash
        1882   56143    8650       2780  pty0      197608 21:52:56 /usr/bin/bash
        8668    8664    8650       7148  pty0      197608 21:02:05 /usr/bin/bash
   ps: unknown option -- w
   Try `ps --help' for more information.

joshrabinowitz avatar Apr 22 '22 01:04 joshrabinowitz