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

v/slow_tests/repl: use real path of test folder for repl tests #20007

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

kimshrier
Copy link
Contributor

@kimshrier kimshrier commented Nov 27, 2023

When running v vlib/v/slow_tests/repl/repl_test.v, test 9 would fail. On one of my machines, /home is a symlink to /usr/home so my home directory /home/kim has a real path of /usr/home/kim.

The problem is that the test folder has the /home/kim prefix and when this value is removed from the result messages returned from a test, the /usr part is still in the error message and therefore it doesn't match the expected output. Lines 61-62 in vlib/v/slow_tests/repl/runner/runner.v remove the working directory from the error messages and without using the real path of tfolder, it does not work properly when the path to tfolder has a symlink in it.

🤖[deprecated] Generated by Copilot at ef06cfd

Fix some REPL tests on Windows by using real paths for temporary folders. Make tfolder mutable and assign it the result of os.real_path in vlib/v/slow_tests/repl/repl_test.v.

🤖[deprecated] Generated by Copilot at ef06cfd

  • Make tfolder mutable and assign it the real path of the created folder to avoid potential issues with symbolic links or relative paths when running the REPL tests on Windows (link)

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Good work.

@spytheman
Copy link
Member

I never thought to test that situation. Very good find.

@spytheman spytheman merged commit ef59808 into vlang:master Nov 27, 2023
43 checks passed
@kimshrier kimshrier deleted the fix_repl_worker_test branch December 9, 2023 19:18
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