Repository navigation
The three refutations in wrappers.bats that asserted nothing - #12
Merged
Merged
Conversation
tests/wrappers.bats came in with #6 after the sweep of tracker#19, and three of its seven bare negations were not the last command of their test, so bash did not apply errexit to them and they asserted nothing: that USER=root in the environment does not hand wp-content to root, that WPROOT=/ in the environment does not make the updater chown / , and that a refused update target is never chowned. All seven are `run !` now, with bats_require_minimum_version 1.5.0, the four in final position included, so no line's meaning depends on its position. Each of the seven goes red when the command it refutes is made to succeed, and each fails with status 1 (grep found nothing), not 2 (no file).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/wrappers.batscame in with #6 after the sweep in Keel-Linux/tracker#19. Three of its seven bare negations were not the last command of their test. A bats test passes or fails on the exit status of its last command, and bash's errexit ignores a negated command, so! cmdanywhere else is never checked:chown -R root:root /.All seven are
run !now, withbats_require_minimum_version 1.5.0. The four that were last in their test are converted too, so that no line only works because of where it sits.Test plan
keel-wordpress-updatefor the three that were dead: calling wp-cli before the target check, chowning wp-content/uploads to root, and chowning/. Each turns this branch red and leaves master green.bats -r testsgreen.Part of Keel-Linux/tracker#19. Must merge before Keel-Linux/.github#14.