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 suite settings should take priority over settings passed by POST #684

Closed
garretraziel opened this issue May 20, 2016 · 7 comments
Closed

Comments

@garretraziel
Copy link
Contributor

garretraziel commented May 20, 2016

Fedora for ARM is distributed not by installation ISO, but by already preinstalled disk image. When I want to schedule our ARM tests, I'm doing so while setting HDD_1_URL, but not ISO. I have one test that boots from this disk, creates user/sets password with our "initial-setup" utility and then saves disk by setting STORE_HDD_1. Then I have another ARM test where I want to use that saved disk, but I cannot, because HDD_1 set on test gets overwritten by parameter passed during test scheduling.

I tried to overcome this by setting HDD_ARM=http://url/to/hdd during POST, HDD_1_URL=%HDD_ARM% on first test and correctly setting HDD_1 on second test, but _URL gets resolved only for parameters set by POST (so HDD_1 wasn't created and disk wasn't downloaded). I also tried to set ASSET_1_URL=http://url/to/hdd during POST, HDD_1=%ASSET_1% on first test and correctly setting HDD_1 on second test and that almost worked (ASSET_1 was created and disk was downloaded), but then disk was placed in other/ directory, not in hdd/ directory (so it couldn't find it).

I cannot come up with mean how to solve this problem (resolving _URL for all parameters would be enough), but I think that parameters set on specific test should take precedence before "generic" parameters passed during POST for all tests.

Rationale is that when I'm passing parameters that are the same for all tests planned by one POST, I should be able to override parameters for specific tests.

@aaannz
Copy link
Contributor

aaannz commented May 20, 2016

I am against this. I think POST requests should have priority. Not everyone has write access to test suites so if someone is developing a test and want to experiment with different settings she must use API call.

Now you have a point, that when there is a dependent test it doesn't make sense to override its variables. So one solution would be to add this logic to iso controller.

@aaannz
Copy link
Contributor

aaannz commented May 20, 2016

The number of disks os-autoinst prepares depends on NUMDISKS variable. So theoretically you can use HDD_2_URL in POST and set HDD_1=%HDD_2% in test suite settings for the parent job and keep the child job as is.
When NUMDISKS is not set or set to 1 it should ignore HDD_2, but scheduler will download it as HDD asset anyway. If it works and you decides to use this, document it somewhere or in half a year it will have a WTF sticker.

@garretraziel
Copy link
Contributor Author

That's true. Other solution would be to create some variable like "NOT_OVERWRITE=HDD_1". I will try your solution on Monday.

@coolo
Copy link
Contributor

coolo commented May 23, 2016

+1 for leaving the priority as it is.

@sysrich
Copy link
Member

sysrich commented May 23, 2016

+1 for leaving the prio as it is

@coolo coolo closed this as completed May 23, 2016
@garretraziel
Copy link
Contributor Author

So using HDD_2 but leaving NUMDISK=1 works, but it's rather hack-y. I still think that not overwriting specifically HDD for consecutive tests is better idea.

@aaannz
Copy link
Contributor

aaannz commented May 24, 2016

It is hacky, true.
There are already some ideas flying around about template inheritance/inclusion which will require some work on how scheduler interprets test variables so I think we can add something like variable names prefixes i.e. +HDD_1 to signalize this variable should not be overwritten. This way it will work for any variable and will not require introducing any new special variable.

AdamWill added a commit to AdamWill/openQA that referenced this issue Jan 25, 2017
As suggested by @aaannz in os-autoinst#684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
AdamWill added a commit to AdamWill/openQA that referenced this issue Jan 25, 2017
As suggested by @aaannz in os-autoinst#684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
AdamWill added a commit to AdamWill/openQA that referenced this issue Jan 28, 2017
As suggested by @aaannz in os-autoinst#684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
AdamWill added a commit to AdamWill/openQA that referenced this issue Jan 28, 2017
As suggested by @aaannz in os-autoinst#684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
AdamWill added a commit to AdamWill/openQA that referenced this issue Jan 29, 2017
As suggested by @aaannz in os-autoinst#684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
coolo pushed a commit that referenced this issue Jan 29, 2017
As suggested by @aaannz in #684, allow specifying a variable
as `+VARIABLE` to signify that it should not be overridden by
another setting of `VARIABLE` later in the usual precedence
order. For instance, usually if the same variable is set in both
a product and a test suite, the test suite setting wins; with
this change, if the product specified `+VARIABLE` and the test
suite `VARIABLE`, the product setting would win. One major use
for this could be to prevent an `HDD_1` set from an ISO post
request overriding the value set in templates for a test which
uses a disk image uploaded by another test.

If multiple things specify `+VARIABLE`, I believe the one that
comes highest in the normal precedence order should win out. We
could, of course, extend this to give `++VARIABLE` even greater
precedence, and so on...:)
coolo pushed a commit that referenced this issue Jan 29, 2017
commit a3709d0
Author:     Adam Williamson <adamw@happyassassin.net>
AuthorDate: Sun Jan 29 13:29:09 2017 +0100
Commit:     Stephan Kulow <coolo@kde.org>
CommitDate: Sun Jan 29 13:29:09 2017 +0100

    Allow override of the usual setting precedence order (#1200)

    As suggested by @aaannz in #684, allow specifying a variable
    as `+VARIABLE` to signify that it should not be overridden by
    another setting of `VARIABLE` later in the usual precedence
    order. For instance, usually if the same variable is set in both
    a product and a test suite, the test suite setting wins; with
    this change, if the product specified `+VARIABLE` and the test
    suite `VARIABLE`, the product setting would win. One major use
    for this could be to prevent an `HDD_1` set from an ISO post
    request overriding the value set in templates for a test which
    uses a disk image uploaded by another test.

    If multiple things specify `+VARIABLE`, I believe the one that
    comes highest in the normal precedence order should win out. We
    could, of course, extend this to give `++VARIABLE` even greater
    precedence, and so on...:)
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

No branches or pull requests

4 participants