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

QE: Fix Recurring Actions test #7646

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

nodeg
Copy link
Member

@nodeg nodeg commented Oct 5, 2023

What does this PR change?

This will

  • restore idempotency regarding SUSE minion child channels
  • fix the issue with the event not showing up
    The screenshot below shows e.g. the output of
And I check radio button "schedule-daily"
And I enter 2 minutes from now as "time-daily_time"

scheduled at around 11:21 am, but this is definitely not nearly around Europe/Berlin.

Image

I adjusted the get_future_time() method according to the following:

https://ruby-doc.org/stdlib-2.5.8/libdoc/date/rdoc/DateTime.html#method-i-strftime

Time (Hour, Minute, Second, Subsecond):
%H - Hour of the day, 24-hour clock, zero-padded (00..23)
%k - Hour of the day, 24-hour clock, blank-padded ( 0..23)

This method was only used in package installation tests, which I tested with my new changes. I also make use of this method in one of the steps used in our Recurring Actions tests to prevent code duplication. I tested this on HEAD.

Package installation step that uses get_future_time() with the new change

  Scenario: Install package in the future and check for staging                             # features/dom.feature:6
      This scenario ran at: 2023-10-05 13:26:50 +0200
Initializing a twopence node for 'sle_minion'.
Host 'sle_minion' is alive with determined hostname suma-head-min-sles15 and FQDN suma-head-min-sles15.mgr.suse.de
Node: suma-head-min-sles15, OS Version: 15-SP4, Family: sles
    Given I am on the Systems overview page of this "sle_minion"                            # features/step_definitions/navigation_steps.rb:429
    And I follow "Software" in the content area                                             # features/step_definitions/navigation_steps.rb:325
      WARN: Step ends with an ajax transition not finished, let's wait a bit!
    And I follow "Packages" in the content area                                             # features/step_definitions/navigation_steps.rb:325
      WARN: Step ends with an ajax transition not finished, let's wait a bit!
    And I follow "Install" in the content area                                              # features/step_definitions/navigation_steps.rb:325
      WARN: Step ends with an ajax transition not finished, let's wait a bit!
    And I enter "orion-dummy-1.1-1.1" as the filtered package name                          # features/step_definitions/navigation_steps.rb:830
    And I click on the filter button                                                        # features/step_definitions/navigation_steps.rb:804
    When I check row with "orion-dummy-1.1-1.1" and arch of "sle_minion"                    # features/step_definitions/navigation_steps.rb:866
    And I click on "Install Selected Packages"                                              # features/step_definitions/navigation_steps.rb:282
    And I pick 3 minutes from now as schedule time                                          # features/step_definitions/datepicker_steps.rb:72
    And I click on "Confirm"                                                                # features/step_definitions/navigation_steps.rb:282
    Then I should see a "1 package install has been scheduled for" text                     # features/step_definitions/navigation_steps.rb:600
    And I wait until the package "orion-dummy-1.1-1.1" has been cached on this "sle_minion" # features/step_definitions/command_steps.rb:954
    And I wait for "orion-dummy-1.1-1.1" to be installed on "sle_minion"                    # features/step_definitions/command_steps.rb:171
      This scenario took: 146 seconds

2 scenarios (2 passed)
14 steps (14 passed)
2m28.823s

Recurring Actions

suma-head-ctl:~/spacewalk/testsuite # cucumber features/secondary/min_recurring_action.feature
Capybara APP Host: https://suma-head-srv.mgr.suse.de:8888
Initializing a twopence node for 'server'.
Host 'server' is alive with determined hostname suma-head-srv and FQDN suma-head-srv.mgr.suse.de
Node: suma-head-srv, OS Version: 15-SP4, Family: sles
Activating XML-RPC API
Using the default profile...
# Copyright (c) 2020-2023 SUSE LLC
# Licensed under the terms of the MIT license.
@skip_if_github_validation @scope_recurring_actions
Feature: Recurring Actions
(...)
31 scenarios (31 passed)
338 steps (338 passed)
8m54.327s

GUI diff

No difference.

  • DONE

Documentation

  • No documentation needed: only internal and user invisible changes

  • DONE

Test coverage

  • Cucumber tests were adjusted

  • DONE

Links

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Re-run a test

If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run:

  • Re-run test "changelog_test"
  • Re-run test "backend_unittests_pgsql"
  • Re-run test "java_pgsql_tests"
  • Re-run test "schema_migration_test_pgsql"
  • Re-run test "susemanager_unittests"
  • Re-run test "javascript_lint"
  • Re-run test "spacecmd_unittests"

The events have to be scheduled a bit more in the future, otherwise they
will not get picked up because they were created at the same time they
will get executed, which does not work.

Furthermore, I adjusted the get_future_time() method according to the
following:

```bash
Time (Hour, Minute, Second, Subsecond):
  %H - Hour of the day, 24-hour clock, zero-padded (00..23)
  %k - Hour of the day, 24-hour clock, blank-padded ( 0..23)
```

This method was only used in package installation tests, which I tested
with my new changes. I also make use of this method in one of the steps
used in our Recurring Actions tests to prevent code duplication.

Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
This will properly restore the child channels for the SUSE minion.

Signed-off-by: Dominik Gedon <dominik.gedon@suse.com>
@nodeg nodeg marked this pull request as ready for review October 5, 2023 14:08
@nodeg nodeg requested a review from a team as a code owner October 5, 2023 14:08
@nodeg
Copy link
Member Author

nodeg commented Oct 5, 2023

This fix did work when running the test suite manually from the controller. However, @wweellddeerr told me, that he had to explicitly define a timezone environment variable (export TZ="Europe/Berlin") on his Podman test environment. But this would be tricky for us, since we have 2 timezones, Nuremberg and Provo.

@ktsamis
Copy link
Contributor

ktsamis commented Oct 5, 2023

This fix did work when running the test suite manually from the controller. However, @wweellddeerr told me, that he had to explicitly define a timezone environment variable (export TZ="Europe/Berlin") on his Podman test environment. But this would be tricky for us, since we have 2 timezones, Nuremberg and Provo.

sumaform sets always NUE timezone in both envs, so don't worry about that https://github.com/uyuni-project/sumaform/blob/f56856e16342c6d50e8bb3f70382c76013a645c3/backend_modules/null/base/variables.tf#L15

@nodeg
Copy link
Member Author

nodeg commented Oct 5, 2023

Good to know. I did not check sumaform, but I did not find any env. variable on the controller, though. However, the timezone was correct on HEAD:

suma-head-ctl:~ # date
Thu 05 Oct 2023 01:14:54 PM CEST
suma-head-ctl:~ # timedatectl
               Local time: Thu 2023-10-05 13:15:16 CEST
           Universal time: Thu 2023-10-05 11:15:16 UTC
                 RTC time: Thu 2023-10-05 11:15:16
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
              NTP service: inactive
          RTC in local TZ: no

@nodeg
Copy link
Member Author

nodeg commented Oct 6, 2023

All tests passed, in case I need to rearrange my commits again.
image

@nodeg nodeg merged commit bd197f2 into uyuni-project:master Oct 6, 2023
11 checks passed
@nodeg nodeg deleted the qe-fix-recurring-actions branch October 6, 2023 06:39
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