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

Using Parameters:dynamic with --execdir may fails #203

Open
ko1nksm opened this issue Mar 28, 2021 · 2 comments
Open

Using Parameters:dynamic with --execdir may fails #203

ko1nksm opened this issue Mar 28, 2021 · 2 comments
Labels
bug Something isn't working WORKING Work in progress

Comments

@ko1nksm
Copy link
Member

ko1nksm commented Mar 28, 2021

The current directory during translated is not correct.

$ shellspec --execdir @basedir "**/spec"
Running: /bin/sh [sh]
...

Finished in 0.18 seconds (user 0.03 seconds, sys 0.12 seconds)
3 examples, 0 failures, -2 examples did not run (unexpected exit?)


Failure examples / Errors: (Listed here affect your suite's status)

shellspec sub/spec/sub_spec.sh # expected 1 examples, but only ran 3 examples
$ tree -a
.
├── .shellspec
├── spec
│   └── spec_helper.sh
└── sub
    ├── .shellspec
    ├── fixtures
    │   ├── file1.txt
    │   ├── file2.txt
    │   └── file3.txt
    └── spec
        ├── spec_helper.sh
        └── sub_spec.sh
# sub/spec/sub_spec.sh
Parameters:dynamic
  pwd > /dev/tty
  # => "/tmp/shellspec/issue" (During the translation, incorrect)
  # => "/tmp/shellspec/issue/sub" (During the test)

  for file in fixtures/*; do
    %data "$file"
  done
End

Example "File test: $1"
  The file "$1" should be exist
End
@ko1nksm ko1nksm added bug Something isn't working WORKING Work in progress labels Mar 28, 2021
@stephenmoloney
Copy link

stephenmoloney commented May 11, 2021

I'm seeing a similar issue.

Finished in 750.06 seconds (user 3329.18 seconds, sys 155.16 seconds)
17 examples, 0 failures, -17 examples did not run (unexpected exit?)


Failure examples / Errors: (Listed here affect your suite's status)

I will try to add more context soon but it occurs when using Parameters:dynamic in a test with a for loop over an array to set the %data

Update:

Here you can see a link to a failed build:

https://github.com/stephenmoloney/localbox/pull/1/checks?check_run_id=2630792469
https://github.com/stephenmoloney/localbox/pull/1/checks?check_run_id=2630792624

Links to the code below:

It seems like the expected number of tests is somehow not correct on the part of shellspec when using %data and a for loop.

@efrecon
Copy link

efrecon commented Jun 15, 2022

I have the same issue when running v 0.28.1. Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WORKING Work in progress
Projects
None yet
Development

No branches or pull requests

3 participants