• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mbland / go-script-bash / 694
95%

Build:
DEFAULT BRANCH: master
Ran 01 Sep 2017 02:15AM UTC
Jobs 1
Files 61
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
694

Pull #195

travis-ci

web-flow
bats/helpers: Improve create_forwarding_script

Also adds `create_forwarding_scripts` to create multiple forwarding
scripts in one call.

The updates to `create_forwrading_script` addresses several shortcomings
that became apparent while using it to test the new test helper
`skip_if_missing_background_utilities` that I'm adding as part of #181.

First, I needed a way to better restrict the `PATH` of the forwarded
command. Trying to set `PATH` while invoking `create_forwarding_script`
would lead to no forwarding script being created if `PATH` excluded the
directory containing the forwarded program. The new `--path` option
resolves this.

That specific change also resolved a bug where `$@` was passed to
`stub_program_in_path`, rather than just the command name argument,
causing the script to contain the arguments after the command name.

It then became apparent that the forwarding script needed to `exec` the
wrapped command. As explained in the implementation comments:

  The `exec` feature of the forwarding script is crucial, otherwise the
  parent process ID within the executed program will be set to the
  process ID of the wrapper, not the process that invoked the wrapper.

  For example, not calling `exec` confuses `bats-exec-test`, which
  invokes itself via `bats_perform_tests`. As a result, in the parent
  process, `bats_preprocess_source` creates BATS_TEST_SOURCE based on
  BATS_TMPNAME, which is based on $$; then
  `bats_evaluate_preprocessed_source` in the child process tries to
  execute BATS_TEST_SOURCE based on BATS_PARENT_TMPNAME, which is based
  on $PPID. Since they're different, Bats raises a 'No such file or
  directory' error.

  The correct thing for Bats to do is prefix its self-execution with
  `BATS_TEST_SOURCE="$BATS_TEST_SOURCE"`, but it's still good practice
  to use `exec` here, and to understand why it's important.
Pull Request #195: bats/helpers: Improve create_forwarding_script

19 of 19 new or added lines in 1 file covered. (100.0%)

2812 of 2971 relevant lines covered (94.65%)

248.57 hits per line

Jobs
ID Job ID Ran Files Coverage
1 694.1 01 Sep 2017 02:15AM UTC 0
94.65
Travis Job 694.1
Source Files on build 694
  • List 0
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #694
  • Pull Request #195
  • PR Base - master (#692)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc