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

test(pkg): Check from which directory a ./cmd is picked #11551

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

shym
Copy link
Contributor

@shym shym commented Mar 20, 2025

Test from which directory local commands, such as ./configure, are called.
The version from the sandbox should be picked, as they could have been created or modified by previous build commands (such as patch).

This is a simplified reproducer for #11514.

@shym
Copy link
Contributor Author

shym commented Mar 20, 2025

Such tests are merged when the corresponding issues are fixed, aren’t they?
Otherwise, I can change the test to silence the failure message to get portability.

@Leonidas-from-XIV
Copy link
Collaborator

Such tests are merged when the corresponding issues are fixed, aren’t they?

No, usually we commit the current error message (with a bit of text explaining what is going wrong, so if someone fixes the issue the test changes and it is clear that this is in fact, expected) and the change in the test shows that the issue was fixed.

@shym shym force-pushed the pkg-test-dotcmd branch from 3f571d1 to 3919e6f Compare March 24, 2025 09:34
@shym
Copy link
Contributor Author

shym commented Mar 24, 2025

No, usually we commit the current error message (with a bit of text explaining what is going wrong, so if someone fixes the issue the test changes and it is clear that this is in fact, expected) and the change in the test shows that the issue was fixed.

Great! I’ve updated the test to suppress the output to make it portable.

(My assumption that failing tests were not merged was based on this comment)

@Leonidas-from-XIV
Copy link
Collaborator

(My assumption that failing tests were not merged was based on #8283 (comment))

Oh, I think this refers to a existing, flaky test that has been flaky for a very long time and I think has actually been fixed since.

> (write-file configure "#!/bin/sh\necho Package configured\n")
> (run chmod +x configure)
> (run sh configure)
> (run ./configure)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it running configure twice here? Is one failing or are both failing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was my work around. You’re right: that was cryptic. I made all that explicit.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, this makes a lot more sense and is well understandable now. Thanks!

Test from which directory local commands, such as `./configure`, are called
The version from the sandbox should be picked, as they could have been
created or modified by previous build commands (such as `patch`)

This is a simplified reproducer for ocaml#11514

Signed-off-by: Samuel Hym <[email protected]>
@shym shym force-pushed the pkg-test-dotcmd branch from 3919e6f to 816caa2 Compare March 24, 2025 10:34
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

Looks very good now!

> (write-file configure "#!/bin/sh\necho Package configured\n")
> (run chmod +x configure)
> (run sh configure)
> (run ./configure)))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, this makes a lot more sense and is well understandable now. Thanks!

@Leonidas-from-XIV Leonidas-from-XIV merged commit e9e2291 into ocaml:main Mar 24, 2025
24 of 25 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