Skip to content

Commit

Permalink
WIP: Requested Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
r-richardson committed Dec 19, 2023
1 parent c32b546 commit e1b2eba
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</button>
</div>
</c:if>

<c:if test='${not scheduleEditable}'>
<div class="panel panel-default">
<div class="panel-heading">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Add no-strict checkbox to manage channel sync page
- Add no-strict checkbox to channel sync page allowing to disable strict mode for package synchronisation
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
- Implement no-strict option:
* Make strict=false the default in reposync.py
* Add no-script parameter handling to spacewalk-repo-sync
- Implement new default behaviour for channel synchronisation, now automatically dropping packages which are deleted from the upstream repository (strict mode)
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Licensed under the terms of the MIT license.

Feature: Strict Mode for Channel Synchronization
In order to control strict mode synchronization
In order to properly manage channel synchronisation
As an admin user
I want to be able to toggle strict mode synchronization via the UI and command line
I want to be able to decide if deleted packages from upstream repos are dropped or kept

Scenario: Create Test-strict-channel
Given I am authorized for the "Admin" section
Expand All @@ -27,7 +27,6 @@ Scenario: Prepare repos for strict test
And I click on "Create Repository"
Then I should see a "Repository created successfully" text

@rrichardson-test
Scenario: Testing strict mode
Given I am authorized for the "Admin" section
And I follow the left menu "Software > Manage > Channels"
Expand All @@ -38,7 +37,7 @@ Scenario: Testing strict mode
And I follow "Sync" in the "content area"
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
And I check the amount of packages in channel "test-strict-channel"
And I store the amount of packages in channel "test-strict-channel"
And I follow "Add / Remove"
And I uncheck "fake-rpm-repo" in the list
And I check "fake-rpm-repo-modified" in the list
Expand All @@ -48,7 +47,6 @@ Scenario: Testing strict mode
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
Then The amount of packages in channel "Test-Strict-Channel" should be the same as before

And I uncheck "no-strict"
And I click on "Sync Now"
And I wait at most 60 seconds until I do not see "Repository sync is running." text, refreshing the page
Expand Down
20 changes: 9 additions & 11 deletions testsuite/features/step_definitions/command_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,28 +135,26 @@
raise 'Failed to login to the API' unless response.code == 200
end

$package_amount = nil

When(/^I check the amount of packages in channel "([^"]*)"$/) do |channel_label|
channels = $api_test.channel.list_all_channels
if channels.key?(channel_label)
package_amount = channels[channel_label]['packages']
puts "Package amount for 'test-strict': #{package_amount}"
When(/^I store the amount of packages in channel "([^"]*)"$/) do |channel_label|
add_context('channels', $api_test.channel.list_all_channels)
if get_context('channels').key?(channel_label)
add_context('package_amount', get_context('channels')[channel_label]['packages'])
puts "Package amount for 'test-strict': #{get_context('package_amount')}"
else
puts "#{channel_label} channel not found."
end
end

Then(/^The amount of packages in channel "([^"]*)" should be the same as before$/) do |channel_label|
channels = $api_test.channel.list_all_channels
if channels.key?(channel_label) && ($package_amount != channels[channel_label]['packages'])
add_context('channels', $api_test.channel.list_all_channels)
if get_context('channels').key?(channel_label) && ( get_context('package_amount') != get_context('channels')[channel_label]['packages'] )
raise 'Package counts do not match'
end
end

Then(/^The amount of packages in channel "([^"]*)" should be fewer than before$/) do |channel_label|
channels = $api_test.channel.list_all_channels
if channels.key?(channel_label) && channels[channel_label]['packages'] >= $package_amount
add_context('channels', $api_test.channel.list_all_channels)
if get_context('channels').key?(channel_label) && get_context('channels')[channel_label]['packages'] >= $package_amount
raise 'Package count is not fewer than before'
end
end
Expand Down
15 changes: 2 additions & 13 deletions testsuite/features/step_definitions/navigation_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -922,22 +922,11 @@
end
end

When(/^I check "([^"]*)" in the list$/) do |text|
raise 'The text to check can\'t be empty' if text.empty?

top_level_xpath_query = "//div[@class=\"table-responsive\"]/table/tbody/tr[.//td[contains(.,'#{text}')]]//input[@type='checkbox']"
row = find(:xpath, top_level_xpath_query, match: :first)
raise ScriptError, "xpath: #{top_level_xpath_query} not found" if row.nil?

row.set(true)
end

When(/^I uncheck "([^"]*)" in the list$/) do |text|
When(/^I (check|uncheck) "([^"]*)" in the list$/) do |check_option, text|
top_level_xpath_query = "//div[@class=\"table-responsive\"]/table/tbody/tr[.//td[contains(.,'#{text}')]]//input[@type='checkbox']"
row = find(:xpath, top_level_xpath_query, match: :first)
raise "xpath: #{top_level_xpath_query} not found" if row.nil?

row.set(false)
row.set(check_option == 'check')
end

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
- features/reposync/srv_create_fake_repositories.feature
- features/reposync/srv_sync_fake_channels.feature
- features/reposync/srv_create_activationkey.feature
- features/reposync/srv_sync_repo_sync.feature
- features/core/srv_osimage.feature
- features/core/srv_docker.feature
## Container features END ###

0 comments on commit e1b2eba

Please sign in to comment.