Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mbland
Copy link
Contributor

@mbland mbland commented Jun 10, 2018

I didn't catch this until trying to update mbland/go-script-bash to use Bats v1.0.0, because we didn't have any bats-core tests validating it.

I know we just pushed v1.0.0 yesterday, but I'm already ready for v1.0.1 once this goes in!

mbland added 2 commits June 9, 2018 20:34
I didn't catch this until trying to update mbland/go-script-bash to use
Bats v1.0.0, because we didn't have any bats-core tests validating it.
As it turns out, the test case shouldn't assume that `PWD` is a parent
directory of `BATS_TEST_DIRNAME`. Our Docker build, which doesn't set
`/opt/bats` as the `WORKDIR`, broke as a result of that assumption:

  https://travis-ci.org/bats-core/bats-core/jobs/390264918

Now the test case uses a path constructed with `PWD` directly, rather
than one constructed with `BATS_TEST_DIRNAME`.
@mbland mbland requested review from a team, btamayo, jasonkarns and sublimino June 10, 2018 00:56
@ghost ghost assigned mbland Jun 10, 2018
@ghost ghost added the review label Jun 10, 2018
@mbland
Copy link
Contributor Author

mbland commented Jun 10, 2018

I also just found another very minor kinda-sorta bug that I'll file a second PR for, then release v1.0.1. Merging this now; as always, please comment after-the-fact if any concerns.

@mbland mbland merged commit 8eef7f0 into master Jun 10, 2018
@ghost ghost removed the review label Jun 10, 2018
@mbland mbland deleted the fix-bats-cwd branch June 10, 2018 02:51
mbland added a commit to mbland/go-script-bash that referenced this pull request Jun 10, 2018
https://github.com/bats-core/bats-core/releases/tag/v1.0.0, while
honoring the same interface as v0.4.0, introduced a few changes that
required some cleanup of our Bats utilities:

- bin/bats is no longer a symlink to libexec/bats, and the latter can no
  longer be invoked directly; hence _GO_BATS_PATH is now set to
  bin/bats.

- TAP output for skipped tests changed in bats-core/bats-core#19.

- run_bats_test_suite_in_isolation depended upon _GO_ROOTDIR and
  _GO_BATS_PATH, which led to bats not being able to find its libexec
  scripts. The bats path is now computed using `command -v bats`, which
  makes the library itself more portable.

- Some assertion-test-helpers output didn't end with a newline. This
  prevented the `while` loop used to replace `sed` in
  bats-core/bats-core#88 from reading the final line of output from the
  test. While this was fixed in bats-core/bats-core#99, updating the
  code to always emit newlines was still the right thing to do.

There was a bug in Bats v1.0.0 in setting `BATS_CWD` that broke the
"assertion-test-helpers: failing assertion must disable shell options"
test case. Specifically, stack trace paths that should've looked like:

  tests/assertion-test-helpers.bash

instead looked like:

  go-script-bash/tests/assertion-test-helpers.bash

This was fixed by bats-core/bats-core#98.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants