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
NEEDLES_DIR documentation and/or behaviour could be improved #4576
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Now tracked additionally as https://progress.opensuse.org/issues/117133 . Also I created https://progress.opensuse.org/issues/117136 to prevent the stale bot to close issues which are still valid. |
The docs just say that one is supposed to set What is your use case? Custom test dir + default needles dir? Then the combination of However, I guess your case is custom test dir + custom needles dir. Then you need to set
If you do not set So the behavior is tailored for having needles in a separate repository. If we can clarify your use case we can of course think of a solution to support it. However, we must not break existing behavior. So maybe we need to introduce an additional variable to tell the openQA worker to treat a relative |
My use case is that I want to allow people to fork and/or branch from the test repo used for openqa.debian.net, where the needles are to be found in They should then be able to set up a new test, and create needles to match, push the result, and then refer to their commit to see if things work. (I really want that to just happen via the gitlab CI setup, so that people don't need to know what's going on to write new tests) If I said that I'd got that working, I think I was confused, since my recollection now is that at one point I thought I had it working, but in fact I'd just pushed the needles in question to the main branch as well, and the test case was picking them up from there. I think that in reality, there was no combination of settings that managed to get hold of a needle that only existed in the commit set via CASEDIR. If you suspect there's a combination of settings that ought to make this work, I am of course very happy to try again. BTW I don't think it should make any difference, but the .png files in that repository are stored via git-lfs, so are not really in the same repo, although they look like they are. |
That makes more sense.
Right, as I said, that use case is not supported at this point.
No. As said before, we'd likely even need to introduce a new variable (instead of just changing the behavior to avoid breaking other use cases). |
Note that last time I was working in that area introducing another variable was deemed to complicated so I resorted to dumping down the cases we can handle. So before implementing anything it would be good if other members of the @tools-team would respond. Otherwise it'll be only frustrating to do changes that are then rejected after all. |
could you provide a bit more context about that, e.g. the commit and/or ticket where you did that? Might help to refresh my memory there :) |
I think I ditched my commits when you've saw them. Not sure whether there's a record (because I mainly remember discussing it in a jitisi session). |
The original proposal goes in the direction of https://progress.opensuse.org/issues/58184 , a bigger feature complex we had planned for the future. My vision is that openQA would be able to care about a complete test definition including needles within one git repository with a secondary use case being layered git repos as presented by the OP. So eventually the plan is to come to that but this will likely take long. An alternative solution might be to use variable expansion within variables so that one could specify something like |
* Allows prepending `%CASEDIR%` to relative `NEEDLES_DIR` so `%CASEDIR%` is replaced with the path where the custom `CASEDIR` will be checked out * Enables use-case of specifying a custom `CASEDIR` and a custom `NEEDLES_DIR` where the custom needles dir is a relative path within the custom `CASEDIR` (and *not* a separate repository or a relative path within the default needles directory). * See https://progress.opensuse.org/issues/117133 * See os-autoinst#4576
* Allows prepending `%CASEDIR%` to relative `NEEDLES_DIR` so `%CASEDIR%` is replaced with the path where the custom `CASEDIR` will be checked out * Enables use-case of specifying a custom `CASEDIR` and a custom `NEEDLES_DIR` where the custom needles dir is a relative path within the custom `CASEDIR` (and *not* a separate repository or a relative path within the default needles directory). * See https://progress.opensuse.org/issues/117133 * See os-autoinst#4576
* Allows prepending `%CASEDIR%` to relative `NEEDLES_DIR` so `%CASEDIR%` is replaced with the path where the custom `CASEDIR` will be checked out * Enables use-case of specifying a custom `CASEDIR` and a custom `NEEDLES_DIR` where the custom needles dir is a relative path within the custom `CASEDIR` (and *not* a separate repository or a relative path within the default needles directory). * See https://progress.opensuse.org/issues/117133 * See os-autoinst#4576
The PR has been merged so we should be good now. (You can of course re-open if there's something missing.) |
Hi Again, I just gave this a try, and it's not working quite as I envisaged. In order to get it to work, I needed to set It strikes me that there are a couple of things wrong with this. The first is that the case dir repo gets cloned into a directory named after the remote repo, so in this case we have It seems wrong to be using the name of the repo that the user specifies here. Wouldn't it be better to always use e.g. Secondly, whatever the directory is called, shouldn't the relative path specified in NEEDLES_DIR be from within that direcotory? (so, in this case I'd expect to specify In fact, I've forgotten why I'm using the It would be nice if one could specify something like BTW I am of course happy to come up with patches to do this, once we've worked out what the preferred approach is. |
Yes. I only implemented it that way because that's consistent with what's done on os-autoinst level when the Git repo is actually cloned. To change that we needed to change the code that does the Git cloning in os-autoinst and then also adapt the newly added openQA worker code accordingly.
No,
Maybe you've copied the structure from openSUSE's test repository (https://github.com/os-autoinst/os-autoinst-distri-opensuse/tree/master/products). It is used for multiple products so there the needles directory is in a distribution-specific path as needles for those different distributions are actually provided by different other repositories. This way of structuring it is supported by openQA as it sets the default product/needles directory to fit that structure. When specifying the needles directory yourself you'll need to take care of that yourself.
I don't think it is normally hunting that way. Normally the openQA worker default-initializes |
Yes, you're right -- I somehow had the impression that I'd originally had things not all under the |
so, getting back to the In particular:
Which is not correct AFAICS. If you have a repo |
Another little wrinkle is that if I specify this:
then the test works, whereas if I specify it like this (with a
if fails, producing this error:
As seen here: https://openqa.debian.net/tests/98227#details ( vs. the working version here: https://openqa.debian.net/tests/98226 ) I guess that's because the latter is being treated as non-relative somehow, but it's not exactly obvious that one should expect that to matter, so I think it should either be explicitly documented, or the code should be fixed to make it work regardless, as deemed appropriate (I've not worked out why the with-slash version would be useful in a distinct way, so would currently assume that they should be treated as equivalent). |
I have needles in the same repo as the tests for the Debian tests (using git-lfs to deal with the bloat, which seems to work well BTW).
If I set the
CASEDIR
to be a branch or commit, it fails with a complaint about not finding the thing it's looking for in the repo.In that case, it creates a symlink in the pool/N directory for the needles, to the default location for the needles repo, which of course does not match the needles in the
CASEDIR
repo.If I set
NEEDLES_DIR=products/debian/needles
then it works.The Documentation says:
which suggests that one should copy the git URL into both variables, but that doesn't work (and strikes me as a bit pointless TBH).
Given this comment about
NEEDLES_DIR
,CASEDIR
&PRODUCTDIR
it seems like the current behaviour is intended, and that one should just set the relative path forNEEDLES_DIR
, in which case I think that should be made more explicit in the docs.Alternatively, it strikes me that since the thing that one is setting
NEEDLES_DIR
to is just$PRODUCTDIR/needles
there really ought to be a way of making it do that automatically, without having to specify thePRODUCTDIR
value twice, but that probably needs to be dependent upon whether the normal repo which theCASEDIR
is almost certainly forked is also an all-in-one or a needles_separate repo.The text was updated successfully, but these errors were encountered: