sobolevn / git-secret

:busts_in_silhouette: A bash-tool to store your private data inside a git repository.
https://sobolevn.me/git-secret/
MIT License
3.73k stars 198 forks source link

travis-ci can't find man pages during tests on ubuntu-rolling and ubuntu-latest #179

Closed joshrabinowitz closed 6 years ago

joshrabinowitz commented 6 years ago

See https://travis-ci.org/sobolevn/git-secret/jobs/378803909 and https://travis-ci.org/sobolevn/git-secret/jobs/378803908

       Use `bundle info [gemname]` to see where a bundled gem is installed.
       Running Serverspec
       ---> RSPEC_CMD variable is: /usr/local/bin/rspec

       git-secret::test
         Package "git-secret"
           should be installed
         Command "find /tmp/git-secret/build -name "*.deb""
           stdout
             should match /git-secret.*deb/
         File "/.git-secret_test-passed"
           should exist
         File "/.git-secret_lint-passed"
           should exist
         Command "dpkg-query --status git-secret"
           exit_status
             should eq 0
         Command "man -w "git-secret""
           exit_status
             should eq 0 (FAILED - 1)
         Command "man -w "git-secret-init""
           exit_status
             should eq 0 (FAILED - 2)

       Failures:

         1) git-secret::test Command "man -w "git-secret"" exit_status should eq 0
            Failure/Error: its(:exit_status) { should eq 0 }

              expected: 0
                   got: 16

              (compared using ==)
              env PATH="/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin" /bin/sh -c man\ -w\ \"git-secret\"

            # ./roles/git-secret/.ci/integration/gnupg1/serverspec/default_spec.rb:46:in `block (3 levels) in <top (required)>'

         2) git-secret::test Command "man -w "git-secret-init"" exit_status should eq 0
            Failure/Error: its(:exit_status) { should eq 0 }

              expected: 0
                   got: 16

              (compared using ==)
              env PATH="/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin" /bin/sh -c man\ -w\ \"git-secret-init\"

            # ./roles/git-secret/.ci/integration/gnupg1/serverspec/default_spec.rb:50:in `block (3 levels) in <top (required)>'

       Finished in 0.09844 seconds (files took 0.41229 seconds to load)
       7 examples, 2 failures

       Failed examples:

       rspec ./roles/git-secret/.ci/integration/gnupg1/serverspec/default_spec.rb:46 # git-secret::test Command "man -w "git-secret"" exit_status should eq 0
       rspec ./roles/git-secret/.ci/integration/gnupg1/serverspec/default_spec.rb:50 # git-secret::test Command "man -w "git-secret-init"" exit_status should eq 0

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #verify action: [SSH exited (1) for command: [            
            mkdir -p /tmp/kitchen
            cd /tmp/kitchen
            RSPEC_CMD=$(which rspec)
            echo "---> RSPEC_CMD variable is: ${RSPEC_CMD}"
             sudo -E -H  $RSPEC_CMD -c -f documentation --default-path  /tmp/kitchen  -P roles/git-secret/.ci/integration/gnupg1/serverspec/*_spec.rb

]] on gnupg1-ubuntu-latest
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
The command "chmod +x ".ci/script.sh" && ".ci/script.sh"" exited with 20.
Done. Your build exited with 1.
joshrabinowitz commented 6 years ago

Note: revert changes in https://github.com/sobolevn/git-secret/pull/181/commits/f2214bde6fc2fbf97b82b1e0a52ffd0d95d7bec5

simbo1905 commented 6 years ago

Looking hard into this I cannot spot any difference with the built deb file and teh install commands so I asked on stackexchange: https://unix.stackexchange.com/questions/448659/manual-pages-of-built-deb-install-on-debian-but-not-ubuntu

you might want to upvote it so that more eyes get to look at it!

simbo1905 commented 6 years ago

Somone supplied the fix! Its probably going to a few hours before I can next run the test suite but it looks to be something like adding a check and remove of /etc/dpkg/dpkg.cfg.d/excludes such as:

# Building .deb package:
if [ -f /etc/dpkg/dpkg.cfg.d/excludes ]; then
    rm /etc/dpkg/dpkg.cfg.d/excludes
fi
cd "$SCRIPT_DEST_DIR" && build_package "deb"
joshrabinowitz commented 6 years ago

Are there other paths listed in /etc/dpkg/dpkg.cfg.d/excludes ?

And perhaps we should do something less severe than just deleting that file?

simbo1905 commented 6 years ago

It just blocks /usr/share/man/ and and /usr/share/doc/

kitchen@ceddd8d3564c:~$ grep -r path-exclude /etc/dpkg/dpkg.cfg /etc/dpkg/dpkg.cfg.d/excludes:path-exclude=/usr/share/man/ /etc/dpkg/dpkg.cfg.d/excludes:path-exclude=/usr/share/doc/*

If we are testing "do we build a valid deb" then the answer is "yes". If we are testing "do we know how users install into /usr/share/man when that is now blacklisted on ubuntu?" then the answer is "no". I think we should release the code and then figure out that as a separate issue.

Running one ubuntu ci test locally the fix works. About to send a PR.

simbo1905 commented 6 years ago

Just to be clear I don't think my server change is about blatting anyone's machine. The change which I just sent over as a PR is run as root as ci test setup where the .deb is built to test it. So at that point, I remove the blacklist so that the .deb can be tested.

Correction It is better to remove the /etc/dpkg/dpkg.cfg.d/excludes in ansible.

simbo1905 commented 6 years ago

I have moved this into ansible on my latest PR.

simbo1905 commented 6 years ago

fixed in #188