Skip to content

Commit

Permalink
Move SAT_NON_GA_VERSIONS constant to robottelo config (#16225)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameerpathan111 authored Sep 6, 2024
1 parent b1ff8a3 commit c707a37
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/auto_branching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ jobs:
old_url="https://raw.githubusercontent.com/SatelliteQE/robottelo/master/tests/foreman/data/uri.sh"
new_url="https://raw.githubusercontent.com/SatelliteQE/robottelo/${{ github.event.inputs.target_branch }}/tests/foreman/data/uri.sh"
FILE_PATH="./robottelo/constants/__init__.py"
awk '/SAT_NON_GA_VERSIONS =/ { sub(/\[[^,]*, /, "[", $0) } 1' "$FILE_PATH" > temp && mv temp "$FILE_PATH"
sed -i.bak "s|${old_url}|${new_url}|" "$FILE_PATH"
rm "$FILE_PATH.bak"
Expand Down Expand Up @@ -258,7 +257,6 @@ jobs:
# update the version
sed -i.bak "s/SATELLITE_VERSION = \"$old_stream_version\"/SATELLITE_VERSION = \"$new_stream_version\"/" "$FILE_PATH"
sed -i.bak "s/ SATELLITE_VERSION: \"$old_stream_version\"/ SATELLITE_VERSION: \"$new_stream_version\"/" ./conf/robottelo.yaml.template
sed -i.bak "s/SAT_NON_GA_VERSIONS = \[.*\]/SAT_NON_GA_VERSIONS = $non_ga_versions/" "$FILE_PATH"
rm "$FILE_PATH.bak" "./conf/robottelo.yaml.template.bak"
- name: git status
Expand Down
4 changes: 4 additions & 0 deletions conf/robottelo.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ ROBOTTELO:
# Satellite version supported by this branch
# UNDR version is used for some URL composition
SATELLITE_VERSION: "6.17"
# Update non-ga versions with each release
SAT_NON_GA_VERSIONS:
- '6.16'
- '6.17'
# The Base OS RHEL Version(x.y) where the satellite would be installed
RHEL_VERSION: "8.10"
# The source of RHEL packages. Can be one of:
Expand Down
6 changes: 6 additions & 0 deletions robottelo/config/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@
robottelo=[
Validator('robottelo.settings.ignore_validation_errors', is_type_of=bool, default=False),
Validator('robottelo.rhel_source', default='ga', is_in=['ga', 'internal']),
Validator(
'robottelo.sat_non_ga_versions',
is_type_of=list,
default=[],
cast=lambda x: list(map(str, x)),
),
],
shared_function=[
Validator('shared_function.storage', is_in=('file', 'redis'), default='file'),
Expand Down
1 change: 0 additions & 1 deletion robottelo/constants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# This should be updated after each version branch
SATELLITE_VERSION = "6.17"
SATELLITE_OS_VERSION = "8"
SAT_NON_GA_VERSIONS = ['6.16', '6.17']

# Default system ports
HTTPS_PORT = '443'
Expand Down
6 changes: 3 additions & 3 deletions tests/foreman/maintain/test_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import yaml

from robottelo.config import robottelo_tmp_dir, settings
from robottelo.constants import MAINTAIN_HAMMER_YML, SAT_NON_GA_VERSIONS
from robottelo.constants import MAINTAIN_HAMMER_YML
from robottelo.hosts import get_sat_rhel_version, get_sat_version

sat_x_y_release = f'{get_sat_version().major}.{get_sat_version().minor}'
Expand Down Expand Up @@ -298,7 +298,7 @@ def test_positive_satellite_repositories_setup(sat_maintain):
"""
sat_version = ".".join(sat_maintain.version.split('.')[0:2])
result = sat_maintain.cli.Advanced.run_repositories_setup(options={'version': sat_version})
if sat_version not in SAT_NON_GA_VERSIONS:
if sat_version not in settings.robottelo.sat_non_ga_versions:
assert result.status == 0
assert 'FAIL' not in result.stdout
result = sat_maintain.execute('yum repolist')
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_positive_capsule_repositories_setup(sat_maintain):
"""
sat_version = ".".join(sat_maintain.version.split('.')[0:2])
result = sat_maintain.cli.Advanced.run_repositories_setup(options={'version': sat_version})
if sat_version not in SAT_NON_GA_VERSIONS:
if sat_version not in settings.robottelo.sat_non_ga_versions:
assert result.status == 0
assert 'FAIL' not in result.stdout
result = sat_maintain.execute('yum repolist')
Expand Down

0 comments on commit c707a37

Please sign in to comment.