-
Notifications
You must be signed in to change notification settings - Fork 711
v2-run needs a way to use package directory #6178
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
Comments
I’m pretty sure tests are run from pkg directory, otherwise `cabal v2-test Cabal:parser-tests` would fail. Which version of cabal-install do you have, is it a regression?
… On 6 Aug 2019, at 12.46, Sam Halliday ***@***.***> wrote:
Describe the bug
v2-test uses the current working directory when invoking the test binary, but this breaks multi-package builds (i.e. projects with a cabal.project) that have test data in a specific location relative to the .cabal file.
For example, aeson-golden tests will fail because they expect to be run from the package directory, not the location of the cabal.project file.
To Reproduce
Steps to reproduce the behavior:
$ cd my-package
$ cabal v2-test
vs
$ cd ..
$ cabal v2-test
Please use version-prefixed commands (e.g. v2-build or v1-build) to avoid ambiguity.
Expected behavior
The tests should run with the CWD set to the directory containing the .cabal file.
System information
Operating system: N/A
cabal, ghc versions: all released versions
** Other Context
Not only does this mean that running tests from the root dir vs the package dir produce different results, but stack uses the convention of always running tests from the dir containing the .cabal file and therefore this subtle change in behaviour makes it difficult to migrate from stack to cabal or for developers to have a choice of build tool on their project.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@phadej apologies, you're right... my reproduction is broken. This is actually a problem with using An alternative solution to the core problem would be if something like |
Closing because I think this is more fundamentally dealt with by fixing #6114 which would allow |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
v2-run tasty
uses the current working directory when invoking thetasty
binary, but this breaks multi-package builds (i.e. projects with acabal.project
) that have test data in a specific location relative to the.cabal
file.For example,
aeson-golden
tests will fail because they expect to be run from the package directory, not the location of thecabal.project
file.To Reproduce
Steps to reproduce the behavior:
vs
Expected behavior
The tests should run with the CWD set to the directory containing the
.cabal
file.System information
cabal
,ghc
versions: all released versions** Other Context
Not only does this mean that running tests from the root dir vs the package dir produce different results, but
stack
uses the convention of always running tests from the dir containing the.cabal
file and therefore this subtle change in behaviour makes it difficult to migrate from stack to cabal or for developers to have a choice of build tool on their project.The text was updated successfully, but these errors were encountered: