-
Notifications
You must be signed in to change notification settings - Fork 697
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 new-run to run tests and benchmarks too #4861
Conversation
@@ -309,11 +311,11 @@ selectPackageTargets targetSelector targets | |||
where | |||
(targetsExesBuildable, | |||
targetsExesBuildable') = selectBuildableTargets' | |||
. filterTargetsKind ExeKind | |||
. (\ts -> concatMap (`filterTargetsKind` ts) [ExeKind, TestKind, BenchKind]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ExeKind
was first argument of filterTargetsKind
, now it's (ts
) is second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? The behavior is the same (note the backticks).
Uuh anyway this whole patch is not in a good shape right now. No need to review it until I polish it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I got confused. Maybe (\kind -> filterTargetsKind kind ts)
would be less mind-twisting, or adding filterTargetKinds :: [ComponentKind] -> ...
4bea5cf
to
40cf289
Compare
This is now ready for review. The failing test is obsolete, I'm |
fc255a3
to
5e92bcf
Compare
CI failures look legit. |
Yeah, I probably have to update/delete that test too since I changed new-run's behavior |
828fa50
to
eefdbfe
Compare
CI is still red, there's a failing test. |
eefdbfe
to
b1a70fe
Compare
With this set of changes that test should have that result. I tried to change it to check the new result, but there is little/no documentation about IntegrationTests2. Maybe I should just delete it |
travis fails because we need for #4962 to get in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review. Few nitpicks.
I'd really like to see a positive test.
selectComponentTargetBasic pkgid cname subtarget t | ||
| otherwise | ||
= Left (TargetProblemComponentNotExe pkgid cname) | ||
= case availableTargetComponentName t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amend the haddock of selectComponentTarget
.
We should be precise here when we mean "executable" and when "executable-like" component. This will cause confusion otherwise.
++ "contains just one executable.\n\n" | ||
++ "Any executable/test/benchmark in any package in the project can be " | ||
++ "specified. A package can be specified if contains just one " | ||
++ "executable. The default is to use the package in the current " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
executable-like component
@@ -869,15 +869,6 @@ testTargetProblemsRun config reportSubCase = do | |||
[ ( CmdRun.TargetProblemNoTargets, mkTargetPackage "p-0.1" ) | |||
] | |||
|
|||
reportSubCase "test-only" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super happy of simply removing this test.
It's invalid with this change, as https://github.com/haskell/cabal/blob/fcabd87406effc0c265312eb38509804682e4623/cabal-install/tests/IntegrationTests2/targets/test-only/p.cabal has only test-suite
stanza, but now has an executable.
Let's change that package to be lib-only
(you cannot run that).
What is pity, we don't have any positive tests for CmdRun
in IntegrationsTests2.hs
. We really should add them, so the things working now continue working in the future.
9462c25
to
e731514
Compare
Done. Except the positive test. I'll do that in another pr
I'm merging this once it's green, since the 15th is near. I promise to do that positive test sometime after my next exam (which is also too near) |
This is especially useful for passing arguments to a single test suite Closes haskell#4684.
Report possible tests and benchmarks too when erroring because of multiple available targets.
Since now new-run can run tests too (but obviously not libs)
As it can now mean a proper executable, a test, or a benchmark
The old comment was probably copypasted from CmdBuild. Now it reflects what new-run actually does.
e731514
to
0ef5bb0
Compare
Oh well, windows and linux is green and one of the four osx builds is green too (the other 3 keep erroring). I'm merging this. |
🎆 |
This is especially useful for passing arguments to a single test suite
ping @merijn this is already usable
Closes #4684