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

[Migrate BootTests] part of #4173 Migrate ghcide tests to hls test utils #4227

Conversation

soulomoon
Copy link
Collaborator

No description provided.

@soulomoon soulomoon marked this pull request as ready for review May 13, 2024 07:46
@@ -676,6 +677,25 @@ runSessionWithServer' disableKick pluginsDp conf sconf caps root s = withLock l
putStrLn $ "Finishing canceling (took " <> showDuration t <> "s)"
pure x

-- | Host a server, and run a test session on it
-- Note: cwd will be shifted into @root@ in @Session a@
Copy link
Collaborator Author

@soulomoon soulomoon May 13, 2024

Choose a reason for hiding this comment

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

I do not think the original is right?

Copy link
Collaborator

@fendor fendor May 13, 2024

Choose a reason for hiding this comment

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

What do you mean? Looks correct to me. If you don't lock, I don't think the tests will work though, as shifting the cwd will affect all tests.

Copy link
Collaborator Author

@soulomoon soulomoon May 13, 2024

Choose a reason for hiding this comment

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

Oh I see, the shift happens in the code of lsp package, right?
We might want one with no lock too, so that it can be run inside the one with the lock. Some test in ghcide need to nest the runs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, the shift happens in the executable https://github.com/haskell/haskell-language-server/blob/master/src/Ide/Main.hs#L126

Ok, I understand that nesting might be necessary sometimes. However, the comment should make it clear that all integration tests need to be locked, since we launch a thread, not a new process, for the tests, which all share the same CWD variable.

Copy link
Collaborator Author

@soulomoon soulomoon May 14, 2024

Choose a reason for hiding this comment

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

Thanks for the classification, it probably be a good idea to eliminate the need for getCurrentDirectory inside IDEMain.defaultMain now. I'll try to do it. Also makeAbsolute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

@soulomoon soulomoon May 14, 2024

Choose a reason for hiding this comment

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

Attempt of getting rid of cwd dependent moved to #4231
Focusing on BootTests migration now.

@soulomoon soulomoon force-pushed the soulomoon/update-ghcide-tests-hls-test-utils-BootTests branch from 67438ef to 25108f4 Compare May 14, 2024 03:01
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@fendor fendor merged commit a1fe52f into haskell:master May 14, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants