-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix testdata hie.yaml generation #517
Comments
Yeah, I force added my hie.yaml after a few hours of debugging why CI was failing but everything worked fine locally. |
@isovector hlint plugin tests was failing for the same reason but then i've remembered your issue/pr relatively early. |
This is a cludge. We should be auto-generating these files. See haskell#517. But for now we can get the tests running, then fix that part later.
We just deleted the "real" cradles (in #741 via #1230) that we use for actually developing hls (and good riddance, if hls can sort-of just-work without users making weird helper files that's great) ... so it seems like a good time to revive this issue. As konn mentions (#741 (comment)) I think we need the ability to handwrite cradles for testing. So long as cradles exist we will want to test what happens when they are weird / malformed / handwritten. In particular, our testdata currently includes "fake" cradles like this:
And:
There's no way we are auto-generating that. Do we want to leave the "fake" cradles in the testdata where they are and close this issue ... or do something else? If we are worried about the "real" hls seeing the "fake" cradles and causing problems while we are developing, then one option would be to rename the "fake" cradles from "testdata/../hie.yaml" to "testdata/../test-hie.yaml", then just before the tests run, we copy "test-hie.yaml" back to "hie.yaml", then after the tests run we can delete all the "hie.yaml" again. (I partially implemented this and it seems like it works just fine.) |
Well, we can always write code parameterized enough to generate the files with something like: generateTestCradle :: Filepath -> [String]
generateTestCradle dir args = ... and make it generate a direct cradle in
Well, in my case i like to open the testdata dir and test manually in the editor before or while i am writing the test, it is not real code so they did not cause problems for me, do they for you? |
Not sure if at this point this continue being relevant |
It is not 🙂 |
@bubba @fendor @isovector me too, analyzing the test code and data:
hie.yaml
, they passhie.yaml
in its subdirectory, despite they were intended to be ignored withhaskell-language-server/.gitignore
Lines 23 to 24 in 438f699
I suppose they were added with
git add --force
. 😺hie.yaml
generated bysetupBuildToolFiles
will not work anymore, as they should include modules explicitlySo, i would ignore
hie.yaml
's but:setupBuildToolFiles
has to include auto all modules in the directory where it is about to be created (not sure if it would be feasible)setupDirectFilesIn
with a new parameter with the modules to add in the direct cradlesetupBuildToolFiles
, or add the modules for each test suite thereThe text was updated successfully, but these errors were encountered: