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

Allow run the tests from any subdirectory under the project directory #130

Closed
ko1nksm opened this issue Nov 22, 2020 · 7 comments · Fixed by #135
Closed

Allow run the tests from any subdirectory under the project directory #130

ko1nksm opened this issue Nov 22, 2020 · 7 comments · Fixed by #135

Comments

@ko1nksm
Copy link
Member

ko1nksm commented Nov 22, 2020

The current implementation does not work properly when run from a subdirectory of the project, because the working directory is not the project root directory . It doesn't make much sense, so change it so that the working directory is the project root directory, no matter which directory you run from.

This is a change that needs attention, but the impact is likely to be minor because it should not be working at present.

And we also need to load such as spec_helper.sh from the the spec directory under the project root instead of the spec directory under the current directory. The spec directory is the default directory and need to add the --helper-dir option to able to change. Issue #123 is also relevant.

This Issue is a fix to address the issue of the Issue #121 working directory.

@ko1nksm ko1nksm added the WORKING Work in progress label Nov 22, 2020
@AntoniMarcinek
Copy link
Contributor

Do I understand correctly, that if I want to have e.q. a custom matcher shared between tests in subdirectories, then this can go to spec directory in the project root and now running shellspec in the test subdirectory it will load the custom matcher from the root/spec directory?

If so, then this is awesome. Then even if #138 is inappropriate to be merged in, I can make it a custom matcher to be shared between my tests.

@ko1nksm
Copy link
Member Author

ko1nksm commented Dec 1, 2020

Yes, In the same project, spec_helper.sh and the files loaded from it always refer to project-root/spec/. This spec can't be changed now, but I'd like to be able to change it with the related #123 and #132.

@AntoniMarcinek
Copy link
Contributor

Nice.

Unfortunately I realised this does not work with my ctest wrapper, because it runs multiple instances of shellspec each for a different spec file/subdirectory, which all print to the same report file root directory/report/results_junit.xml. So for the wrapper I am left with setting the subdirectory as the root directory (touching there an empty .shellspec file) and I cannot use the common helper, unless the wrapper also links/copies the spec directory around. So I will use this only in the pure shellspec solution once all prerequisites are implemented.

@ko1nksm ko1nksm removed the WORKING Work in progress label Dec 2, 2020
@AntoniMarcinek
Copy link
Contributor

@ko1nksm I see you have added --reportdir option, which solves the above problem. Thank you! When do you expect to make a release?

@ko1nksm
Copy link
Member Author

ko1nksm commented Dec 22, 2020

There was more work to do than I expected, so it's taking longer. I'm going to release 0.28.0 after at least addressing #144. I can't promise, but I hope to release it by the end of this month.

@ko1nksm
Copy link
Member Author

ko1nksm commented Dec 31, 2020

@AntoniMarcinek The development of version 0.28.0 is finished, and only the documentation remains, but there are some number of projects that have installed the latest version (without specifying the version) with CI, so I will release it on 2021-01-05 midday (UTC) to keep a peaceful new year 🎍. If you want to try the latest version, use the master branch.

@AntoniMarcinek
Copy link
Contributor

Splendid, thank you!

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

Successfully merging a pull request may close this issue.

2 participants