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

Normalize tests invocation #12367

Merged
merged 1 commit into from
Jul 23, 2019
Merged

Conversation

marusak
Copy link
Member

@marusak marusak commented Jul 19, 2019

I am just testing this. And with having opened PR that has these changes (when this lands, all PRs needs to rebase) it is easier to test.

Blocked on:

@marusak marusak added the no-test For doc/workflow changes, or experiments which don't need a full CI run, label Jul 19, 2019
@marusak marusak force-pushed the unify_test_names branch 2 times, most recently from 1ad2112 to 8ab20f5 Compare July 19, 2019 11:15
@@ -183,7 +181,7 @@ class PullTask(object):
# explicit request for html logs
status["link"] = "log.html"
status["extras"] = [ "https://raw.githubusercontent.com/cockpit-project/cockpit/master/bots/task/log.html" ]
elif self.context.startswith("cockpit/"):
elif self.test_project:
Copy link
Member

Choose a reason for hiding this comment

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

This will regress the log.html bits for cockpit further down below, right? At least we want test_project to be something like cockpit-project/cockpit for cockpit itself, or isn't that the case yet?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I also though that TEST_PROJECT would be set up to cockpit-project/cockpit but it isn't.
This is what tests-scan outputs for cockpit test:

PRIORITY=0001 bots/make-checkout --verbose --base=master --repo=cockpit-project/cockpit pull/12361/head 0985a3bbfff2a97fa7f36d1a9253280db9dd3202 && GITHUB_BASE=cockpit-project/cockpit TEST_NAME=pull-12361-20190719-132222 TEST_REVISION=0985a3bbfff2a97fa7f36d1a9253280db9dd3202 bots/tests-invoke --pull-number=12361  --rebase=master fedora-30/selenium-chrome pull/12361/head

and this is for external project:

PRIORITY=0005 bots/make-checkout --verbose --base=master --repo=cockpit-project/starter-kit --bots-ref=pull/12361/head '' && TEST_PROJECT=cockpit-project/starter-kit TEST_NAME=pull-12361-20190719-132222 TEST_REVISION=0985a3bbfff2a97fa7f36d1a9253280db9dd3202 bots/tests-invoke --pull-number=12361  --rebase=master --remote=test centos-7 ''

I admit that I took this shortcut and just misused the fact that this is not set up.

Copy link
Member

Choose a reason for hiding this comment

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

Right, I figured something like that -- too many "cockpit" special cases. While we are at it, could you please test for cockpit here, and somewhere at the top make it default to cockpit, with a FIXME?

@marusak marusak force-pushed the unify_test_names branch from 8ab20f5 to 2badc91 Compare July 19, 2019 13:56
@marusak marusak added the blocked Don't land until something else happens first (see task list) label Jul 19, 2019
"fedora-30/selenium-chrome",
"fedora-30/selenium-firefox",
"fedora-30/selenium-edge",
"fedora-30/avocado-fedora",
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be just fedora-30/avocado-fedora, right? the -fedora is pointless there.

Copy link
Member

Choose a reason for hiding this comment

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

Right, let's make this just /avocado (I suppose that's what you actually meant).

@@ -55,6 +55,7 @@
# it will publish a test task to the queue (used to trigger specific contexts)
NOT_TESTED_DIRECT = "Not yet tested (direct trigger)"

# TODO this is not gonna work, is it?
Copy link
Member Author

Choose a reason for hiding this comment

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

Now we won't be able to use this OUR_CONTEXTS, since tests are going to start always with TEST_OS. @martinpitt mentioned something about this and that he talked about it with @Gundersanne. What was the agreed solution?

Copy link
Member

Choose a reason for hiding this comment

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

I had something else in mind when I said that we shouldn't need a static "cockpit/" prefix. Indeed we'll have to rework this. known_context() is used in tests-trigger as a sanity check to prevent us trying to e. g. retry semaphore with this (which won't work). But the more important user is statuses().

So either known_context() checks if the first part (.split('/')[0]) exists (as link) in bots/images/ (some caching should be involved), or we have to use a static cockpit/ prefix. I'm just a bit concerned about test names getting too long, with the extra /branch name that we want to tack at the end. We could shorten it to "c/"..

But WDYT about the "is this a known image" check? It's not that expensive and easy to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

But WDYT about the "is this a known image" check? It's not that expensive and easy to do.

I agree that checking if the first part is valid image makes sense. Adding cockpit could make some names way too long and it is still just noise. The same goes with c/. I'll take a look at this and send some commit.

@martinpitt martinpitt removed the blocked Don't land until something else happens first (see task list) label Jul 22, 2019
@martinpitt
Copy link
Member

Both prerequisite PRs landed, unblocking.

@marusak marusak force-pushed the unify_test_names branch 2 times, most recently from 7720777 to f8ebb22 Compare July 23, 2019 05:18
for project in testmap.projects():
for branch_tests in testmap.tests_for_project(project).values():
if context in branch_tests:
return True
Copy link
Member Author

Choose a reason for hiding this comment

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

One problem with this - this will mark fedora-30/verify as unknown context although it is equivalent to fedora-30 which would be a known context. Is this a problem and should this just split context at \ and then split also all contexts from the map and check it exists?

Copy link
Member

Choose a reason for hiding this comment

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

It's a bit unfortunate, but I don't think it will be a real-life problem. In principle we have this problem today already with non-cockpit problems. I think it's fine to start with the convention that the "verify" scenario isn't spelled out.

],
'rhel-7.7': ['avocado/fedora', 'container/kubernetes', 'container/bastion',
'selenium/firefox', 'selenium/chrome', 'verify/rhel-7-7',
'rhel-7.7': ['fedora-30/avocado-fedora', 'fedora-30/container-kubernetes',
Copy link
Member Author

Choose a reason for hiding this comment

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

containers, avocado and selenium are always F30 no matter which branch, right?

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather not make this assumption. We regularly update the image for these, and then also (have to) update the stable branches to keep up. But the point of this is to be more flexible, and always specify the OS. What's the background of your question?

@marusak
Copy link
Member Author

marusak commented Jul 23, 2019

Rebased and edited to work with new changes. I've posted two comments in the code that I am not certain about.

All projects support `test/run` script, so lets use this.
Also context now is image[/scenario]. Scenario cannot contain '/' and is
not necessary. It is every `test/run` scripts duty to be able to parse
TEST_OS and SCENARIO environment variables.
@marusak marusak force-pushed the unify_test_names branch from f8ebb22 to 78336d3 Compare July 23, 2019 05:26
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

This looks fine now, thank you! Rolling this out will cause some disturbance on existing PRs as you can't retry failed tests with "old" names any more. Once this lands, I'm happy to ping @atodorov and other affected people, but please send out a quick mail to cockpit-devel@ about this (even before landing).

Asking @Gundersanne to have a final look, as she also worked on this. Otherwise, please land when ready, and we stand by to do emergency actions if something fails :-)

@martinpitt martinpitt requested a review from croissanne July 23, 2019 06:45
Copy link
Contributor

@croissanne croissanne left a comment

Choose a reason for hiding this comment

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

Compared it to whatever I had, it seems to do all of that and more, and more elegantly!

I also tried this out a little bit with a local amqp instance, it seems to produce the correct results (though running the commands, it fails at tests-invoke in the rebase which is normal as all current PR's will need a rebase).

so LGTM! This will make stuff a lot nicer :D

This was referenced Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-test For doc/workflow changes, or experiments which don't need a full CI run,
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants