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

reftest: add test for variables resolutions in filter, for all fields #5643

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rjbou
Copy link
Collaborator

@rjbou rjbou commented Aug 24, 2023

No description provided.

@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from 2e16743 to 0f61464 Compare August 24, 2023 15:59
@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from c191f42 to d53f6f9 Compare September 20, 2023 13:55
@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from d53f6f9 to 25837cf Compare December 12, 2023 10:13
@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from 25837cf to 930e28e Compare April 9, 2024 16:52
@rjbou rjbou requested review from kit-ty-kate and dra27 May 3, 2024 08:49
@kit-ty-kate kit-ty-kate removed their request for review May 9, 2024 13:24
Copy link
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

I haven't gone through the test properly, but unlike #5642, I think this one is a good candidate for a reftest. I half wondered with the tests which produce messages if it would be worth piping the whole thing through an appropriate grep just to keep the output smaller?

Comment on lines 1640 to 1642
match OpamProcess.run
(make_command ~verbose:OpamCoreConfig.(!r.verbose_level >= 3)
~name:"patch" patch_cmd ["--version"]) with
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't feel like a good to stop having -vv display all commands run... is there anywhere else we already do this?

Copy link
Member

Choose a reason for hiding this comment

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

I don't think this change should be part of this PR

Copy link
Member

Choose a reason for hiding this comment

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

I've removed that part from the PR. Feel free to revert to the previous commit if you prefer to have the previous version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

After checking, not really, the other instances are for verbose level >= 2. The only instance where it is >=3 is for commands run by depext, to avoid the big log.

@rjbou rjbou added this to the 2.3 milestone Jun 27, 2024
@kit-ty-kate kit-ty-kate force-pushed the test-resolve-variables-in-filters branch from 97f6c16 to d2b04b6 Compare July 9, 2024 18:08
@rjbou rjbou marked this pull request as draft July 10, 2024 13:55
@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from d2b04b6 to a9c2b0a Compare August 29, 2024 18:11
@rjbou rjbou marked this pull request as ready for review August 29, 2024 18:11
@rjbou rjbou requested a review from kit-ty-kate August 29, 2024 18:11
tests/reftests/run.ml Outdated Show resolved Hide resolved
Comment on lines +273 to +301
### <pkg:patches.1:some-content>
blabla
pioupiou
bloblob
### <pkg:patches.1:to-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -1,3 +1,3 @@
blabla
-pioupiou
+ploplop
bloblob
### <pkg:patches.1:to-not-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -2,3 +2,3 @@
ploplop
-bloblob
+noooooo
### <pkg:patches.1>
opam-version: "2.0"
patches: [
"to-apply.patch" { ?smtg }
"to-not-apply.patch" { !?smtg }
]
build: [
[ "grep" "ploplop" "some-content" ]
[ "grep" "bloblob" "some-content" ]
]
Copy link
Member

Choose a reason for hiding this comment

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

This section is already defined in line 18 of the same file

Comment on lines +326 to +331
### <pkg:build.1>
opam-version: "2.0"
build: [
[ "true" { ?smtg } ]
[ "false" { !?smtg } ]
]
Copy link
Member

Choose a reason for hiding this comment

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

already defined above

Comment on lines +344 to +349
### <pkg:install.1>
opam-version: "2.0"
install: [
[ "true" { ?smtg } ]
[ "false" { !?smtg } ]
]
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +361 to +366
### <pkg:runtest.1>
opam-version: "2.0"
run-test: [
[ "true" { ?smtg } ]
[ "false" { !?smtg } ]
]
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +489 to +494
### <pkg:post-msg.1>
opam-version: "2.0"
post-messages: [
"Bye!" { ?smtg }
">>smtg is undefined<<" { !?smtg }
]
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +507 to +509
### <pkg:avail.1>
opam-version: "2.0"
available: [ ?smtg ]
Copy link
Member

Choose a reason for hiding this comment

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

same

Comment on lines +536 to +554
### <pkg:patches.1:some-content>
blabla
pioupiou
bloblob
### <pkg:patches.1:to-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -1,3 +1,3 @@
blabla
-pioupiou
+ploplop
bloblob
### <pkg:patches.1:to-not-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -2,3 +2,3 @@
ploplop
-bloblob
+noooooo
Copy link
Member

Choose a reason for hiding this comment

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

these files don't have to be redefined

Comment on lines +781 to +799
### <pkg:patches.1:some-content>
blabla
pioupiou
bloblob
### <pkg:patches.1:to-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -1,3 +1,3 @@
blabla
-pioupiou
+ploplop
bloblob
### <pkg:patches.1:to-not-apply.patch>
--- a/some-content 2020-12-02 14:22:55.364620832 +0100
++ b/some-content 2020-12-02 14:23:05.668686881 +0100
@@ -2,3 +2,3 @@
ploplop
-bloblob
+noooooo
Copy link
Member

Choose a reason for hiding this comment

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

these files don't have to be redefined

Comment on lines +776 to +778
### :::::::::::::::::::::::::::
### :: Self package variable ::
### :::::::::::::::::::::::::::
Copy link
Member

Choose a reason for hiding this comment

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

for this section i think it would be also be useful to show the behaviour of opam when the package has already been installed. Like, for each fields, show the behaviour as is done currently, then force-install the package and try to install it again and show if there is a difference of behaviour

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated with these tests in a separate commit

@rjbou rjbou force-pushed the test-resolve-variables-in-filters branch from a9c2b0a to 4972b20 Compare October 14, 2024 17:38
Copy link
Collaborator Author

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

On file definition redundancy, the main idea is to have all information about the given test in its section. But there is 2 different cases:

  • patches that never changes, are always redefined, and their content it not so much important to understand the given test
  • opam files that are the same for a subset of the tests, they are more important to understand why it fails or not (how is used the variable).
    I think that patches can be grouped at the beginning of the test, but opam files add more readability if they are duplicated in their own section.

Comment on lines +776 to +778
### :::::::::::::::::::::::::::
### :: Self package variable ::
### :::::::::::::::::::::::::::
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated with these tests in a separate commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants