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

[WIP] Search more needle directory #1569

Closed
wants to merge 1 commit into from

Conversation

Amrysliu
Copy link
Contributor

@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #1569 (f8f31ce) into master (912dfbd) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1569      +/-   ##
==========================================
+ Coverage   60.38%   60.41%   +0.02%     
==========================================
  Files          56       56              
  Lines        6548     6545       -3     
==========================================
  Hits         3954     3954              
+ Misses       2594     2591       -3     
Impacted Files Coverage Δ
needle.pm 80.21% <100.00%> (+0.10%) ⬆️
backend/driver.pm 93.42% <0.00%> (+1.11%) ⬆️
cv.pm 82.35% <0.00%> (+8.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 912dfbd...f8f31ce. Read the comment docs.

@kalikiana
Copy link
Member

So if I understand the logic correctly, this might be better phrased as "Fallback to initial productdir if the needledir is not found", where #3578 is needed to record the initial productdir in case it gets overwritten

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

The commit message could have a bit more details, e.g. what issue is fixed, why this needs to change, to which versions of which product it applies, link to a bug or a fate entry, the choices you made, etc. Also see https://commit.style/ or http://chris.beams.io/posts/git-commit/ as a helpful guide how to write good commit messages.

Also I would appreciate if you can look into adding tests.

@@ -327,6 +327,7 @@ sub default_needles_dir {
sub init {
$needles_dir = ($bmwqemu::vars{NEEDLES_DIR} // default_needles_dir);
$needles_dir = File::Spec->catdir($bmwqemu::vars{CASEDIR}, $needles_dir) unless -d $needles_dir;
$needles_dir = "$bmwqemu::vars{INIT_PRODUCTDIR}/needles" unless -d $needles_dir;
Copy link
Member

Choose a reason for hiding this comment

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

hm, I am thinking that this isn't a very clear design because the variable INIT_PRODUCTDIR has no meaning within the scope of os-autoinst and having an incorrect PRODUCTDIR specified for os-autoinst is also not something that makes much sense. Keep in mind that isotovideo as standalone tool cares only about a single test with no history of "previous jobs" or anything. As the "check for a needle directory" is actually only a check if a directory with name "needles" exists I think here it would be better if you move the corresponding logic to openQA code. So it would be like the openQA worker code tries to "repair" the variable PRODUCTDIR in https://github.com/os-autoinst/openQA/pull/3578/files#diff-53098d895ef28f5c7db596e2dc505d7c8ee24b6a9a4cca23865fb225e10cd9fcR332 if otherwise no needle can be found.

Copy link
Contributor Author

@Amrysliu Amrysliu Nov 25, 2020

Choose a reason for hiding this comment

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

In general, we don't need INIT_PRODUCTDIR, but when the PRODUCTDIR is a relative path (for example the job is trigger by openqa-clone-custom-git-refspec), we need this to find the needles_dir.

I think here it would be better if you move the corresponding logic to openQA code.

if we move this logic to openQA code, when users specify NEEDLES_DIR as a GitHub or GitLab path, it will not work. Because the git check out happens in checkout_git_repo_and_branch on https://github.com/os-autoinst/os-autoinst/blob/master/OpenQA/Isotovideo/Utils.pm#L50

@Amrysliu Amrysliu changed the title Search more needle directory [WIP] Search more needle directory Nov 26, 2020
@okurz
Copy link
Member

okurz commented Nov 26, 2020

So what I am considering: As stated in #1569 (comment) this PR is trying to fix a real problem based on an already suboptimal design of the interface between os-autoinst and openQA. Hence I created https://progress.opensuse.org/issues/80372 to solve that. But I am tending to accept this PR as a "temporary workaround" – which by nature tend to stay forever – but at least we should do the following:

  • Only try to expand the directory if the variable "INIT_PRODUCTDIR" is defined
  • Document the variable as a "workaround" in doc/backend_vars.asciidoc
  • Add the explanation from [WIP] Search more needle directory #1569 (comment) in the code as comment
  • Update the git commit message to describe the situation, the problem and the proposed solution

@Amrysliu can you do that?

@Amrysliu
Copy link
Contributor Author

we already have #1577, so close this

@Amrysliu Amrysliu closed this Dec 11, 2020
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.

4 participants