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

Port 'TestFlags' to 'new-test' #5455

Merged
merged 7 commits into from
Nov 12, 2018

Conversation

harpocrates
Copy link
Collaborator

@harpocrates harpocrates commented Jul 24, 2018

Make all of the old-style test flags available to new-test/new-build/new-install/etc. This should include:

  • --log (as --test-log)
  • --machine-log (as --test-machine-log)
  • --show-details (as --test-show-details)
  • --keep-tix-files (as --test-keep-tix-files)
  • --test-options (as --test-options)
  • --test-option (as --test-option)

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.

Please also shortly describe how you tested your change. Bonus points for added tests!


Fixes #4803
Fixes #4643
Fixes #4766
Fixes #5416

@harpocrates
Copy link
Collaborator Author

As it stands, I’m sure this PR is broken in all sorts of small ways. However, I would love if someone with some experience could look over the general approach - I’m not very knowledgeable in cabal, so this whole PR might be fundamentally flawed and it would be great to know that before I start fixing the smaller bugs.

This scratches a longstanding itch I’ve had for the Haddock test suite:

haddock$ cabal new-test --test-option="--accept" html-test latex-test hoogle-test

@harpocrates harpocrates force-pushed the feature/new-test-flags branch 3 times, most recently from 8bea237 to 1a634ba Compare July 25, 2018 15:18
@harpocrates harpocrates changed the title [WIP] Port 'TestFlags' to 'new-test' Port 'TestFlags' to 'new-test' Jul 25, 2018
@harpocrates
Copy link
Collaborator Author

harpocrates commented Jul 25, 2018

This is ready for review.

Assuming everything that passed before I rebased continues to pass, there will be one CI failure. Specifically, GHCVER=7.10.3 SCRIPT=script USE_GOLD=YES crashes when GHC runs out of memory (relevant log line). If this is indeed my responsibility, I would appreciate some pointers on where to start debugging this.

EDIT

Looks like Travis is going to be all green, but now Appveyor is failing where it wasn't before. I'm going to assume this is all due to flakiness in the tests.

@@ -696,6 +713,9 @@ instance Arbitrary PackageConfig where
instance Arbitrary HaddockTarget where
arbitrary = elements [ForHackage, ForDevelopment]

instance Arbitrary TestShowDetails where
arbitrary = elements [Never, Failures, Always, Streaming, Direct]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elements [minBound..maxBound] in case we add/remove some constructors

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you say it, why not arbitraryBoundedEnum :: (Bounded a, Enum a) => Gen a?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Naively threads 'TestFlags' through the 'new-test' argument parsing
through to the backend.
This means that test flags can be passed in to 'new-build', 'new-install',
'new-configure', etc. I've mostly just followed the lead of 'HaddockFlags'
here.
Paths with escaped characters would, instead of shrinking, grow.
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-7.8.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-7.6.3"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-8.2.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-8.0.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-8.4.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-8.6.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"linux-8.4.4-fdebug-expensive-assertions"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"osx-7.8.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "b5858c66b1ae318e2288a79e531a30a488b89b5c",
"tag":"osx-8.0.2"
}
@@ -15,6 +15,9 @@
no longer ignores all arguments except the last one (#5512).
* Add the following option aliases for '-dir'-suffixed options:
'storedir', 'logsdir', 'packagedir', 'sourcedir', 'outputdir' (#5484).
* Ported old-style test options to the new-style commands (#5455).

2.4.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a mis-merge here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-7.8.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-7.6.3"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-7.10.3"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-8.2.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-8.0.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-8.4.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-8.6.2"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"osx-7.8.4"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"linux-8.4.4-fdebug-expensive-assertions"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"osx-7.10.3"
}
haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 12, 2018
"url":"pull/5455",
"account":"haskell",
"repo":"cabal",
"commit": "c71343083987a725f2b393b8f30793eada7325ee",
"tag":"osx-8.0.2"
}
@harpocrates
Copy link
Collaborator Author

@quasicomputational Could we merge this soon? I'm getting tired of rebasing and of having to direct people to a workaround for Haddock. I really want to just tell folks to run

$ cabal new-test -w ghc-head html-test --test-options="--accept"

instead of explaining why we need

$ cabal new-run -w ghc-head html-test -- \
       --accept \
       --ghc-path ghc-head \
       --haddock-path "$(pwd)/dist-newstyle/build/x86_64-osx/ghc-8.7.20181106/haddock-2.22.0/x/haddock/build/haddock/haddock

The only CI failure looks network related.

@quasicomputational
Copy link
Contributor

LGTM. I'd say to go ahead and merge whenever - I can't see any problems and nor has anyone else, evidently.

@harpocrates harpocrates merged commit de5d2c5 into haskell:master Nov 12, 2018
@harpocrates
Copy link
Collaborator Author

Thanks for the review @quasicomputational - I've merged.

@harpocrates harpocrates deleted the feature/new-test-flags branch November 12, 2018 20:04
@harendra-kumar
Copy link

@harpocrates is there a reason for the --test-show-details to not work with ghcjs build. I am noticing that it seems to work fine with ghc builds but not ghcjs.

@harpocrates
Copy link
Collaborator Author

@harendra-kumar Not that I know of. What are you seeing? Does cabal v1-test work?

@harendra-kumar
Copy link

@harpocrates I think there is no difference in the two cases, I had the wrong idea about that. However, earlier when I used --show-details=always in the CI tests, the output came on console as the tests were running. Now it does not seem to work that way, but --test-show-details=streaming does that job for me. So I am good.

Rufflewind added a commit to Rufflewind/directory that referenced this pull request Sep 6, 2022
Some caveats:

  * Cabal version in CI has been bumped to 3.0+ due to need of test
    flags support: haskell/cabal#5455

  * v1-copy was dropped, since it requires v1 build artifacts. There is
    no v2-copy command AFAICT.

  * I don't think there is an equivalent for the v1-install command for
    libraries?
Rufflewind added a commit to Rufflewind/directory that referenced this pull request Sep 6, 2022
Some caveats:

  * Cabal version in CI has been bumped to 3.0+ due to need of test
    flags support: haskell/cabal#5455

  * v1-copy was dropped, since it requires v1 build artifacts. There is
    no v2-copy command AFAICT.

  * I don't think there is an equivalent for the v1-install command for
    libraries?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants