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.bats failures #6

Closed
lectrode opened this issue Oct 30, 2017 · 5 comments
Closed

tests.bats failures #6

lectrode opened this issue Oct 30, 2017 · 5 comments

Comments

@lectrode
Copy link
Owner

The following are the test failures from the latest release of apacman:

~snip~
 ✗ invoke with '-S' parameter fails to build broken package from AUR
   (in test file tests.bats, line 74)
     `[ "$status" -eq 8 ]' failed
~snip~
 ✗ invoke with '-G' parameter download AUR package source
   (in test file tests.bats, line 97)
     `[ ${lines[-1]} = "$pattern" ]' failed
 ✗ invoke with '-G' parameter download old AUR package source
   (in test file tests.bats, line 105)
     `match=$(grep -o -e pkgver.* -e pkgrel.* ${fakedir}/${histpkg}/.SRCINFO | awk '{printf $NF"-"}' | sed 's/-$//' | grep -o "$pattern")' failed
   grep: /tmp/testing/jbxkb/.SRCINFO: No such file or directory
 ✗ invoke with '-G' parameter choose download old AUR package source
   (in test file tests.bats, line 114)
     `[ ${lines[2]} = "$pattern" ]' failed
 ✗ prepare proot environment
   (in test file tests.bats, line 122)
     `[ "$status" -eq 0 ]' failed
 - invoke with '-S' parameter install package group (skipped)
 ✗ invoke with '-S' parameter install virtual package
   (in test file tests.bats, line 136)
     `result=$(proot -b "${fakedir}/var:/var" $APACMAN $testing -S $virtualpkg --noconfirm --buildonly <<< $(echo -e "\n") 2>&1)' failed with status 255
~snip~

22 tests, 6 failures, 1 skipped

There are 2 additional failures from after changes I made. I will need to look at the two new ones. I may look at some of the other ones as well.

 ✗ interactive search install package
   (in test file tests.bats, line 59)
     `[ "$status" -eq 0 ]' failed
 ✗ interactive search install nonexistant package
   (in test file tests.bats, line 64)
     `[ "$status" -eq 4 ]' failed
@lectrode
Copy link
Owner Author

Found out what caused the 2 additional errors listed above. There was a typo on line 1769. Still not sure how that slipped through, but I guess that's exactly what that testing tool is for. I'll look at the other errors more before committing the fix for that.

@lectrode
Copy link
Owner Author

 ✗ invoke with '-S' parameter fails to build broken package from AUR
   (in test file tests.bats, line 74)
     `[ "$status" -eq 8 ]' failed

Actual status is 5, as $badpkg (which is set to "afuse") no longer exists in AUR. I do not know of another "broken" package to test. Skipping this test until another broken package can be found.

✗ prepare proot environment
   (in test file tests.bats, line 122)
     `[ "$status" -eq 0 ]' failed

Workaround: add export PROOT_NO_SECCOMP=1 to tests.bats

@lectrode
Copy link
Owner Author

lectrode commented Oct 31, 2017

✗ invoke with '-G' parameter download AUR package source
   (in test file tests.bats, line 97)
     `[ ${lines[-1]} = "$pattern" ]' failed
✗ invoke with '-G' parameter download old AUR package source
   (in test file tests.bats, line 105)
     `match=$(grep -o -e pkgver.* -e pkgrel.* ${fakedir}/${histpkg}/.SRCINFO | awk '{printf $NF"-"}' | sed 's/-$//' | grep -o "$pattern")' failed
   grep: /tmp/testing/jbxkb/.SRCINFO: No such file or directory
 ✗ invoke with '-G' parameter choose download old AUR package source
   (in test file tests.bats, line 114)
     `[ ${lines[2]} = "$pattern" ]' failed

These are fixed by replacing -b ${fakedir}:$HOME with -b ${fakedir} -b $HOME in each test

@lectrode
Copy link
Owner Author

✗ invoke with '-S' parameter install virtual package
   (in test file tests.bats, line 136)
     `result=$(proot -b "${fakedir}/var:/var" $APACMAN $testing -S $virtualpkg --noconfirm --buildonly <<< $(echo -e "\n") 2>&1)' failed with status 255

Fixed by updating the test command. The test package has 10 options now instead of 9.

@lectrode
Copy link
Owner Author

lectrode commented Nov 1, 2017

Tested with latest tests.bats and apacman code. Commit to follow shortly.

$ bats tests.bats
 ✓ test command is found
 ✓ invoking without arguments prints usage
 ✓ invoke with nonexistent parameter returns 1
 ✓ invoking with '--help' parameter prints usage
 ✓ invoke with '--version' parameter prints ascii art
 ✓ invoke with '--verbose' parameter without package argument
 ✓ test internet connectivity
 ✓ interactive search install package
 ✓ interactive search install nonexistant package
 ✓ invoke with '-S' parameter installs package from AUR
 - invoke with '-S' parameter fails to build broken package from AUR (skipped)
 ✓ invoke with '-S' parameter installs cached AUR package
 ✓ invoke with '-S' parameter installs non-AUR package
 ✓ invoke with '-S' parameter fails to install nonexistant package
 ✓ prepare proot environment
 ✓ invoke with '-G' parameter download AUR package source
 ✓ invoke with '-G' parameter download old AUR package source
 1) 0.7-2 with '-G' parameter choose download old AUR package source                                     18/22
2) 0.7-1

 ✓ invoke with '-G' parameter choose download old AUR package source
 - invoke with '-S' parameter install package group (skipped)
 1) noto-fonts '-S' parameter install virtual package                                                    20/22
2) noto-fonts-extra
3) ttf-bitstream-vera
4) ttf-croscore
5) ttf-dejavu
6) ttf-freefont
7) ttf-linux-libertine
8) ttf-droid
9) ttf-liberation
10) ttf-ubuntu-font-family

 ✓ invoke with '-S' parameter install virtual package
 ✓ clean proot environment
 ✓ invoke with '-L' parameter lists installed packages by size

22 tests, 0 failures, 2 skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant