-
Notifications
You must be signed in to change notification settings - Fork 37
Conversation
src/Rules/Test.hs
Outdated
f :: Stage -> Package -> Action FilePath | ||
f stage pkg | isLibrary pkg = pkgConfFile (Context stage pkg (read "v")) | ||
| otherwise = programPath =<< programContext stage pkg | ||
|
||
needTestBuilders :: Action () | ||
needTestBuilders = do | ||
needBuilder $ Ghc CompileHs Stage2 | ||
needBuilder $ GhcPkg Update Stage1 | ||
needBuilder Hp2Ps |
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.
Hp2Ps
is already included into testsuitePackages
, so I guess we can drop this line?
src/Settings/Builders/Make.hs
Outdated
check_ppr <- f checkPpr | ||
check_api_annotations <- f checkApiAnnotations | ||
return ["TEST_HC=" ++ test_hc, "CHECK_PPR=" ++ check_ppr, "CHECK_API_ANNOTATIONS=" ++ check_api_annotations] | ||
where |
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.
Let's rename f
to something more informative, perhaps, fullPath
.
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.
Also, a type signature might help.
src/Rules/Test.hs
Outdated
need targets | ||
where | ||
f :: Stage -> Package -> Action FilePath | ||
f stage pkg | isLibrary pkg = pkgConfFile (Context stage pkg (read "v")) |
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 think you need vanillaContext
here.
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.
Btw, are there testsuite-only libraries? If yes, are you sure vanilla
is sufficient for the testsuite?
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.
This bit of code is taken directly from Rules.hs.
There are many errors coming from rts library (40). Although I still couldn't figure out from where errors are coming, I have added this part just in case.
src/Rules/Test.hs
Outdated
targets <- mapM (f Stage1) =<< testsuitePackages | ||
need targets | ||
where | ||
f :: Stage -> Package -> Action FilePath |
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.
Please choose a more informative name instead of f
.
@@ -63,13 +64,24 @@ testRules = do | |||
-- Execute the test target. | |||
buildWithCmdOptions env $ target (vanillaContext Stage2 compiler) RunTest [] [] | |||
|
|||
-- | Build extra programs required by testsuite |
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.
The code below suggests that there are not only testsuite programs, but also testsuite libraries.
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.
@chitrak7 So, do you really need to handle libraries here?
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 have to handle rts library. I just cannot yet figure out how.
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.
Why do you need to handle rts
here? How is it related to the testsuite?
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 still don't understand why needTestsuiteBuilders
needs libraries. Can testsuitePackages
contain library packages? Right now there are only contain programs. If testsuitePackages
can contain libraries, then you need to rename this function to something like needTestsuitePackages
(instead of Builders
).
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.
Some files are missing in rts library causing multiple failures. At the moment, I cannot figure out which files are missing. Or they may be missing includes. I have to look into this matter further.
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 don't understand how rts
relates to this question. You don't have rts
in testsuitePackages
.
The comment for this function says "Build extra programs required by testsuite", but the implementation can also build libraries. This is an inconsistency that should be fixed.
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.
Okay! I think I should create an issue regarding this and temporarily install required programs 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.
Resolved
@chitrak7 Thanks! I've added some comments. |
@chitrak7 Do you have any idea at this point of why we're still skipping so many tests? (this is not a comment/request on the actual patch, I'm just curious and this still feels like the best place to ask) |
src/GHC.hs
Outdated
hsc2hs, hp2ps, hpc, hpcBin, integerGmp, integerSimple, iservBin, libffi, | ||
mtl, parsec, parallel, pretty, primitive, process, rts, runGhc, stm, | ||
templateHaskell, terminfo, text, time, touchy, transformers, unlit, unix, | ||
win32, xhtml, ghcPackages, isGhcPackage, defaultPackages, testsuitePackages, |
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.
nit: this diff looks unnecessarily big
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.
@izgzhen At the moment this is unavoidable. We might refactor this to one package per line at some point if such large diffs look distracting, but it would be better to do it in a separate PR.
@alpmestan I do not exactly know that, Can you give me pointers on where to look. More importantly, why does testsuite decide to skip a test. |
@snowleopard Can you please see why recursive rule failure is coming? |
You should see some information about this in the testsuite driver initialization part of the output (early on, when you look at the full log). |
@alpmestan I believe skipped tests are because of using "fast" option with testsuite. |
@chitrak7 OK. If you ever get a chance to, it would be terrific to add a way to run the equivalent of |
@chitrak7 Please resolve merge conflicts. |
@chitrak7 Something is wrong, looks like you've duplicated the recent commits instead of rebasing. |
@snowleopard I have reset my repository and made necessary changes. It is currently failing due to "llvm" issue. I will resend it once that PR Lands. |
Should the title of this PR be "Add support for nofib testsuite" ? We already support |
No, support for nofib was the goal of #599, not this PR. This PR is about supporting the execution of more tests, and about building things that are required by some of them which were not built previously. It still skips a whole bunch of tests but maybe @chitrak7 could provide an overview of the state of things with/without the commits from his branch? In terms of # of tests being run, # of broken test expectations. |
I just noticed that this PR also add a new file |
Right, my commits somehow did not get merged properly apparently. But you cann tell they've already been merged because they refer to the PR number. |
4a04db1
to
b439d95
Compare
Hi @snowleopard @angerman, I have pushed the work done with validation implementation. |
@chitrak7 Thanks! Let's come back to this PR once we fix Hadrian. |
src/Hadrian/Utilities.hs
Outdated
@@ -481,3 +484,6 @@ renderUnicorn ls = | |||
ponyPadding = " " | |||
boxLines :: [String] | |||
boxLines = ["", "", ""] ++ (lines . renderBox $ ls) | |||
|
|||
data TestSpeed = Slow | Average | Fast deriving (Show, Eq) |
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 sure TestSpeed
is a generally useful data type. It's certainly useful for the GHC build system, but other build systems may have different settings or may not even need a testsuite (remember, Hadrian.*
namespace is for generic functionality that may be useful not only for building GHC).
I suggest to move TestSpeed
to the CommandLine
module.
src/Settings/Builders/Make.hs
Outdated
compiler <- expr $ fullpath ghc | ||
checkPpr <- expr $ fullpath checkPpr | ||
checkApiAnnotations <- expr $ fullpath checkApiAnnotations | ||
let t = show $ max 4 (threads - 2) |
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.
Since the validation script will likely be the only running thread, we do not need to reduce parallelism like we do with other Make invocations. I suggest we use the threads
settings as is.
src/CommandLine.hs
Outdated
|
||
readTestWays :: Maybe String -> Either String (CommandLineArgs -> CommandLineArgs) | ||
readTestWays ways = |
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 don't understand, does this argument correspond to (multiple) ways or to a single way? Looking below, you expect to see a single way in Just
. Shall this be renamed? If you worry about the clash of names, you can use maybeWay
here.
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.
Every argument takes a single way. Multiple ways can be specified by this taking one way at a time.
eg: --test-way=way1 --test-way=way2
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.
Then this function should be renamed to readTestWay
, since it reads a single way.
src/CommandLine.hs
Outdated
, Option [] ["test-verbose"] (OptArg readTestVerbose "TEST_VERBOSE") | ||
"A verbosity value between 0 and 5. 0 is silent, 4 and higher activates extra output." | ||
, Option [] ["test-way"] (OptArg readTestWays "TEST_WAY") | ||
"only run these ways" ] |
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.
We need to document all these flags. You don't need to do this right in this PR, but at least please create an issue so that we don't forget about this.
src/CommandLine.hs
Outdated
, testJUnit :: Maybe FilePath | ||
, testConfigs :: [String] } | ||
, testThreads :: Maybe String | ||
, testVerbosity:: Maybe String |
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.
Hadrian (or Shake) already has -jN
option, which is enough to control the speed of running testsuite. We don't need the testThreads
here.
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.
@sighingnow Indeed! Well spotted.
Removed indentation error
src/Hadrian/Utilities.hs
Outdated
@@ -30,7 +30,7 @@ module Hadrian.Utilities ( | |||
(<&>), (%%>), cmdLineLengthLimit, | |||
|
|||
-- * Useful re-exports | |||
Dynamic, fromDynamic, toDyn, TypeRep, typeOf | |||
Dynamic, fromDynamic, toDyn, TypeRep, typeOf, |
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.
Drop the comma
compiler <- expr $ fullpath ghc | ||
checkPpr <- expr $ fullpath checkPpr | ||
checkApiAnnotations <- expr $ fullpath checkApiAnnotations | ||
return [ "fast" |
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.
Is the "fast"
above related to TestSpeed.Fast
?
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.
No, this is the default validate argument. Speed can be specified by running ./build.sh test and not validate.
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.
Worst case, we can later arrange to support --slow
and --fast
flags, like the actual validate
script, can't we?
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.
Yeah. I can do that right now.
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.
OK, I guess we can leave this for later.
OK, I think we can merge this -- there are a few minor issues but we can fix them later. @alpmestan Do you have any further comments? |
No, let's merge 👍 |
, testSummary :: Maybe FilePath | ||
, testJUnit :: Maybe FilePath | ||
, testConfigs :: [String] } | ||
, testVerbosity:: Maybe String |
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.
Shake already provides a --verbose
option, let's reuse 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.
The verbose option of Shake is boolean, whereas test suite supports 5 levels of verbosity. This is why I chose to pass a separate verbose argument.
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 think that it may be convenient to control these two verbosity settings separately: you might want verbose testing, but not Shake diagnostic info. And vice versa. So, let's keep this flag.
Merged. Many thanks @chitrak7, and everyone else for the review! |
@snowleopard @angerman
Validation result after this push:
SUMMARY for test run started at Mon May 14 00:32:42 2018 IST
0:20:37 spent to go through
6359 total tests, which gave rise to
23523 test cases, of which
17231 were skipped