Skip to content

Commit

Permalink
Merge pull request #9287 from jordimassaguerpla/ci_add_gh_actions_acc…
Browse files Browse the repository at this point in the history
…eptance_tests_coverage

Increase coverage of acceptance tests github workflow
  • Loading branch information
raulillo82 authored Oct 2, 2024
2 parents 0cee34c + b7e5846 commit 8ceb11d
Show file tree
Hide file tree
Showing 33 changed files with 175 additions and 54 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/acceptance_tests_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
env:
UYUNI_PROJECT: uyuni-project
UYUNI_VERSION: master
NO_AUTH_REGISTRY: no_auth_registry
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}
AUTH_REGISTRY: "auth_registry"
AUTH_REGISTRY_CREDENTIALS: "cucutest|cucutest"
jobs:
paths-filter-1:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -67,8 +70,8 @@ jobs:
run: ./testsuite/podman_runner/01_setup_tmp_dirs.sh
- name: create-podman-network
run: ./testsuite/podman_runner/02_setup_network.sh
- name: start_controller
run: ./testsuite/podman_runner/03_run_controller.sh
- name: start_controller_and_registry_and_buildhost
run: ./testsuite/podman_runner/03_run_controller_and_registry_and_buildhost.sh
- name: create_ssh_conf
run: ./testsuite/podman_runner/04_setup_ssh_controller.sh
- name: install_gems_in_controller
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/acceptance_tests_secondary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
acceptance-tests-secondary:
# Skip running scheduled jobs on forks
if: (github.repository == 'uyuni-project/uyuni' || github.event_name != 'schedule')
uses: ./.github/workflows/acceptance_tests_common.yml
with:
secondary_tests: "18_run_secondary_tests.sh"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/acceptance_tests_secondary_parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
acceptance-tests-secondary-parallel:
# Skip running scheduled jobs on forks
if: (github.repository == 'uyuni-project/uyuni' || github.event_name != 'schedule')
uses: ./.github/workflows/acceptance_tests_common.yml
strategy:
fail-fast: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright (c) 2016-2023 SUSE LLC
# Licensed under the terms of the MIT license.

@buildhost
Feature: Bootstrap a build host via the GUI

Scenario: Log in as admin user
Given I am authorized for the "Admin" section

Scenario: Check the new bootstrapped build host in System Overview page
When I follow the left menu "Salt > Keys"
And I accept "build_host" key in the Salt master
And I wait until I do not see "Loading..." text
Then I should see a "accepted" text
When I follow the left menu "Systems > System List > All"
# the build host entitlement adds some extra minutes to apply the salt high-state
And I wait at most 500 seconds until I see the name of "build_host", refreshing the page
Then the Salt master can reach "build_host"

Scenario: Enable "Container Build Host" system type
Given I am on the Systems overview page of this "build_host"
When I follow "Properties" in the content area
And I check "Container Build Host"
And I check "OS Image Build Host"
And I click on "Update Properties"

Scenario: Check that the build host is a build host
Given I am on the Systems overview page of this "build_host"
Then I should see a "[Container Build Host]" text
Then I should see a "[OS Image Build Host]" text

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Feature: Build image with authenticated registry
And I enter URI, username and password for registry
And I click on "create-btn"
Then I wait until I see "registry" text


@scc_credentials
Scenario: Create a profile for the authenticated image store as Docker admin
When I follow the left menu "Images > Profiles"
And I follow "Create"
Expand All @@ -31,6 +32,7 @@ Feature: Build image with authenticated registry
And I click on "create-btn"
Then I wait until I see "auth_registry_profile" text

@scc_credentials
Scenario: Build an image in the authenticated image store
When I follow the left menu "Images > Build"
And I select "auth_registry_profile" from "profileId"
Expand All @@ -46,12 +48,14 @@ Feature: Build image with authenticated registry
Then table row for "auth_registry_profile" should contain "1"
And the list of packages of image "auth_registry_profile" with version "latest" is not empty

@scc_credentials
Scenario: Cleanup: remove Docker profile for the authenticated image store
When I follow the left menu "Images > Profiles"
And I check the row with the "auth_registry_profile" text
And I click on "Delete"
And I click on the red confirmation button
And I should see a "Image profile has been deleted." text
And I wait until no Salt job is running on "build_host"

Scenario: Cleanup: remove authenticated image store
When I follow the left menu "Images > Stores"
Expand All @@ -63,5 +67,3 @@ Feature: Build image with authenticated registry
Scenario: Cleanup: delete registry image
When I delete the image "auth_registry_profile" with version "latest" via API calls

Scenario: Cleanup: Make sure no job is left running on buildhost
When I wait until no Salt job is running on "build_host"
43 changes: 34 additions & 9 deletions testsuite/features/secondary/buildhost_docker_build_image.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
@buildhost
@scope_building_container_images
@no_auth_registry
@skip_if_github_validation
Feature: Build container images

Scenario: Log in as org admin user
Expand All @@ -38,6 +39,7 @@ Feature: Build container images
And I enter "Docker/serverhost" relative to profiles as "path"
And I click on "create-btn"

@scc_credentials
Scenario: Create an image profile with activation key
When I follow the left menu "Images > Profiles"
And I follow "Create"
Expand All @@ -47,6 +49,7 @@ Feature: Build container images
And I enter "Docker" relative to profiles as "path"
And I click on "create-btn"

@scc_credentials
Scenario: Create a simple real image profile with activation key
When I follow the left menu "Images > Profiles"
And I follow "Create"
Expand All @@ -56,6 +59,7 @@ Feature: Build container images
And I enter "Docker/serverhost" relative to profiles as "path"
And I click on "create-btn"

@scc_credentials
Scenario: Build the suse_key image with and without activation key
Given I am on the Systems overview page of this "build_host"
When I schedule the build of image "suse_key" via API calls
Expand All @@ -75,6 +79,7 @@ Feature: Build container images
And I wait at most 300 seconds until image "suse_simple" with version "latest" is inspected successfully via API
Then the list of packages of image "suse_simple" with version "latest" is not empty

@scc_credentials
Scenario: Build the suse_real_key image with and without activation key
Given I am on the Systems overview page of this "build_host"
When I schedule the build of image "suse_real_key" via API calls
Expand All @@ -85,6 +90,7 @@ Feature: Build container images
Then the list of packages of image "suse_real_key" with version "latest" is not empty
When I wait until no Salt job is running on "build_host"

@scc_credentials
Scenario: Build suse_key images with different versions
When I schedule the build of image "suse_key" with version "Latest_key-activation1" via API calls
And I wait at most 600 seconds until image "suse_key" with version "Latest_key-activation1" is built successfully via API
Expand All @@ -99,11 +105,15 @@ Feature: Build container images
Then the list of packages of image "suse_simple" with version "Latest_simple" is not empty
When I wait until no Salt job is running on "build_host"

Scenario: Delete image via API calls
@scc_credentials
Scenario: Delete image via API calls with key
When I delete the image "suse_key" with version "Latest_key-activation1" via API calls
And I delete the image "suse_simple" with version "Latest_simple" via API calls
Then the image "suse_simple" with version "Latest_key-activation1" doesn't exist via API calls
And the image "suse_simple" with version "Latest_simple" doesn't exist via API calls
When I wait until no Salt job is running on "build_host"

Scenario: Delete image via API calls without key
When I delete the image "suse_simple" with version "Latest_simple" via API calls
Then the image "suse_simple" with version "Latest_simple" doesn't exist via API calls
When I wait until no Salt job is running on "build_host"

Scenario: Rebuild suse_simple image
Expand All @@ -113,13 +123,15 @@ Feature: Build container images
Then the list of packages of image "suse_simple" with version "Latest_simple" is not empty
When I wait until no Salt job is running on "build_host"

@scc_credentials
Scenario: Rebuild suse_key image
When I schedule the build of image "suse_key" with version "Latest_key-activation1" via API calls
And I wait at most 600 seconds until image "suse_key" with version "Latest_key-activation1" is built successfully via API
And I wait at most 300 seconds until image "suse_key" with version "Latest_key-activation1" is inspected successfully via API
Then the list of packages of image "suse_key" with version "Latest_key-activation1" is not empty
When I wait until no Salt job is running on "build_host"

@scc_credentials
Scenario: Build an image via the GUI
When I follow the left menu "Images > Build"
And I select "suse_real_key" from "profileId"
Expand All @@ -131,6 +143,7 @@ Feature: Build container images
And I wait at most 600 seconds until image "suse_real_key" with version "GUI_BUILT_IMAGE" is built successfully via API
And I wait at most 300 seconds until image "suse_real_key" with version "GUI_BUILT_IMAGE" is inspected successfully via API

@scc_credentials
Scenario: Login as Docker image administrator and build an image
Given I am authorized as "docker" with password "docker"
When I follow the left menu "Images > Build"
Expand All @@ -143,26 +156,38 @@ Feature: Build container images
And I wait at most 600 seconds until image "suse_real_key" with version "GUI_DOCKERADMIN" is built successfully via API
And I wait at most 300 seconds until image "suse_real_key" with version "GUI_DOCKERADMIN" is inspected successfully via API

Scenario: Cleanup: delete all images
@scc_credentials
Scenario: Cleanup: delete all images with key
Given I am authorized as "admin" with password "admin"
When I delete the image "suse_key" with version "latest" via API calls
And I delete the image "suse_key" with version "Latest_key-activation1" via API calls
And I delete the image "suse_simple" with version "latest" via API calls
And I delete the image "suse_simple" with version "Latest_simple" via API calls
And I delete the image "suse_real_key" with version "latest" via API calls
And I delete the image "suse_real_key" with version "GUI_BUILT_IMAGE" via API calls
And I delete the image "suse_real_key" with version "GUI_DOCKERADMIN" via API calls

Scenario: Cleanup: delete all profiles
Scenario: Cleanup: delete images without key
Given I am authorized as "admin" with password "admin"
When I delete the image "suse_simple" with version "latest" via API calls
And I delete the image "suse_simple" with version "Latest_simple" via API calls

@scc_credentials
Scenario: Cleanup: delete all profiles with key
When I follow the left menu "Images > Profiles"
And I check "suse_simple" in the list
And I check "suse_real_simple" in the list
And I check "suse_key" in the list
And I check "suse_real_key" in the list
And I click on "Delete"
And I should see a "Are you sure you want to delete selected profiles?" text
And I click on the red confirmation button
And I wait until I see "Image profiles have been deleted" text

Scenario: Cleanup: delete all profiles without key
When I follow the left menu "Images > Profiles"
And I check "suse_simple" in the list
And I check "suse_real_simple" in the list
And I click on "Delete"
And I should see a "Are you sure you want to delete selected profiles?" text
And I click on the red confirmation button
And I wait until I see "Image profiles have been deleted" text

Scenario: Cleanup: Make sure no job is left running on buildhost
When I wait until no Salt job is running on "build_host"
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# - features/secondary/srv_docker_cve_audit.feature
# If the image is not created, the message shown is "There are no entries to show."

@skip_if_github_validation
@skip_if_cloud
@buildhost
@scope_retail
@scope_building_container_images
@scc_credentials
Feature: Build OS images

Scenario: Log in as org admin user
Expand Down
8 changes: 5 additions & 3 deletions testsuite/features/secondary/min_ansible_control_node.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2021-2024 SUSE LLC
# Licensed under the terms of the MIT license.

@skip_if_github_validation
@scope_ansible
Feature: Operate an Ansible control node in a normal minion

Expand All @@ -10,13 +9,14 @@ Feature: Operate an Ansible control node in a normal minion

Scenario: Pre-requisite: Deploy test playbooks and inventory file
When I deploy testing playbooks and inventory files to "sle_minion"

@skip_if_github_validation
@susemanager
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_update_repo tools_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"

# TODO: Check why tools_update_repo is not available on the openSUSE minion
# TODO: Check why tools_update_repo is not available on the openSUSE minion
@skip_if_github_validation
@uyuni
Scenario: Pre-requisite: Enable client tools repositories
When I enable the repositories "tools_pool_repo os_pool_repo" on this "sle_minion"
Expand Down Expand Up @@ -90,12 +90,14 @@ Feature: Operate an Ansible control node in a normal minion
And I remove package "orion-dummy" from this "sle_minion" without error control
And I remove "/tmp/file.txt" from "sle_minion"

@skip_if_github_validation
@susemanager
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "sle_minion"
When I disable the repositories "tools_update_repo tools_pool_repo" on this "sle_minion"
And I refresh the metadata for "sle_minion"

@skip_if_github_validation
@uyuni
Scenario: Cleanup: Disable client tools repositories
Given I am on the Systems overview page of this "sle_minion"
Expand Down
14 changes: 10 additions & 4 deletions testsuite/features/secondary/min_deblike_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# - features/secondary/srv_monitoring.feature: as this feature disables/re-enables monitoring capabilities
# - sumaform: as it is configuring monitoring to be enabled after deployment

@skip_if_github_validation
@scope_monitoring
@scope_res
@deblike_minion
Expand All @@ -13,6 +12,7 @@ Feature: Monitor SUMA environment with Prometheus on a Debian-like Salt minion
As an authorized user
I want to enable Prometheus exporters

@skip_if_github_validation
Scenario: Pre-requisite: enable Prometheus exporters repository on the Debian-like minion
When I enable the necessary repositories before installing Prometheus exporters on this "deblike_minion"

Expand All @@ -39,18 +39,22 @@ Feature: Monitor SUMA environment with Prometheus on a Debian-like Salt minion
And I click on "Save"
Then I should see a "Formula saved" text

@skip_if_github_validation
Scenario: Apply highstate for Prometheus exporters on the Debian-like minion
When I follow "States" in the content area
And I click on "Apply Highstate"
Then I should see a "Applying the highstate has been scheduled." text
And I wait until event "Apply highstate scheduled" is completed

@skip_if_github_validation
Scenario: Wait for services
When I wait until "node" exporter service is active on "deblike_minion"
And I wait until "apache" exporter service is active on "deblike_minion"
And I wait until "postgres" exporter service is active on "deblike_minion"

Scenario: Visit monitoring endpoints on the Debian-like minion
When I wait until "node" exporter service is active on "deblike_minion"
And I visit "Prometheus node exporter" endpoint of this "deblike_minion"
And I wait until "apache" exporter service is active on "deblike_minion"
And I visit "Prometheus apache exporter" endpoint of this "deblike_minion"
And I wait until "postgres" exporter service is active on "deblike_minion"
And I visit "Prometheus postgres exporter" endpoint of this "deblike_minion"

Scenario: Cleanup: undo Prometheus exporter formulas on the Debian-like minion
Expand All @@ -59,11 +63,13 @@ Feature: Monitor SUMA environment with Prometheus on a Debian-like Salt minion
And I click on "Save"
Then I wait until I see "Formula saved" text

@skip_if_github_validation
Scenario: Cleanup: apply highstate after test monitoring on the Debian-like minion
When I follow "States" in the content area
And I click on "Apply Highstate"
Then I should see a "Applying the highstate has been scheduled." text
And I wait until event "Apply highstate scheduled" is completed

@skip_if_github_validation
Scenario: Cleanup: disable Prometheus exporters repository on the Debian-like minion
When I disable the necessary repositories before installing Prometheus exporters on this "deblike_minion" without error control
4 changes: 3 additions & 1 deletion testsuite/features/secondary/min_docker_api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@
# - features/secondary/buildhost_docker_build_image.feature
# - features/secondary/buildhost_docker_auth_registry.feature

@skip_if_github_validation
@skip_if_cloud
@scope_building_container_images
@no_auth_registry
Feature: API "image" namespace for containers and sub-namespaces

Scenario: Test "image.store" namespace
When I create and delete an image store via API
And I list image store types and image stores via API
And I set and get details of image store via API

@scc_credentials
Scenario: Test "image.profiles" namespace
When I create and delete profiles via API
And I create and delete profile custom values via API
And I list image profiles via API
And I set and get profile details via API

@scc_credentials
Scenario: Cleanup: remove custom system info
Given I am authorized
When I follow the left menu "Systems > Custom System Info"
Expand Down
Loading

0 comments on commit 8ceb11d

Please sign in to comment.