Skip to content

Commit

Permalink
DynaConf CI native changes required in Robottelo
Browse files Browse the repository at this point in the history
* Dynaconf Native Airgun and Nailgun configuration
* Initial Robottelo and Server DynaConf YAMLs - The robottelo copy of Gitlab SateQE Jenkins
* Commented non-default settings instead of placeholder
* New repos missed in robottelo from jenkins-configs
* Tools and RHEL8_OS repo dependent tests updated for new dynaconf YAMLs
* Removed Robottelo and Server sections from robottelo.properties.sample
* Separate repos.yaml and swapped the places of robottelo and server settings in YAML
* Logging updated for dynaconf. robottelo and server settings base config removed
  • Loading branch information
jyejare authored and JacobCallahan committed Feb 15, 2021
1 parent 6ce2e00 commit a33f706
Show file tree
Hide file tree
Showing 15 changed files with 299 additions and 341 deletions.
1 change: 1 addition & 0 deletions .github/workflows/merge_to_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
pip uninstall -y pycurl
pip install --compile --no-cache-dir pycurl
pip install -U -r requirements.txt -r requirements-optional.txt
for conffile in conf/*.yaml.template; do mv -- "$conffile" "${conffile%.yaml.template}.yaml"; done
cp robottelo.properties.sample robottelo.properties
cp broker_settings.yaml.example broker_settings.yaml
cp virtwho.properties.sample virtwho.properties
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
pip uninstall -y pycurl
pip install --compile --no-cache-dir pycurl
pip install -U -r requirements.txt -r requirements-optional.txt
for conffile in conf/*.yaml.template; do mv -- "$conffile" "${conffile%.yaml.template}.yaml"; done
cp robottelo.properties.sample robottelo.properties
cp broker_settings.yaml.example broker_settings.yaml
cp virtwho.properties.sample virtwho.properties
Expand Down
31 changes: 31 additions & 0 deletions conf/repos.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
REPOS:
# Provide link to rhel6/7/8 repo here, as puppet rpm would require packages from
# RHEL 6/7/8 repo and syncing the entire repo on the fly would take longer for
# tests to run Specify the *.repo link to an internal repo for tests to execute properly
RHEL6_REPO: replace-with-rhel8-repo-http-link
RHEL7_REPO: replace-with-rhel8-repo-http-link
RHEL8_REPO: replace-with-rhel8-repo-http-link
# Provide link to rhel6/7/8 repositories URL as we need all OS packages in order
# to have real installation media for provisioning procedure
# RHEL6_OS: replace-with-rhel6-os-http-link
# RHEL7_OS: replace-with-rhel7-os-http-link
# RHEL8_OS:
# BASEOS: replace-with-rhel8-os-baseos-http-link
# APPSTREAM: replace-with-rhel8-os-appstream-http-link
# If capsule and satellite tools repositories available related packages will
# be pulled from there instead of using the CDN channel. These information is
# more suited to be used for downstream, downstream-iso and zstream builds.
# CAPSULE_REPO: replace-with-capsule-http-link
# SATTOOLS_REPO:
# RHEL6: replace-with-rhel6-http-link
# RHEL7: replace-with-rhel7-http-link
# RHEL8: replace-with-rhel8-http-link
# Downstream Satellite-maintain repo
# SATMAINTENANCE_REPO: replace_with_sat_maintain_repo
# Software Collection Repo
# RHSCL_REPO: replace_with_rhscl_repo
# Ansible 2.8 Repo
# ANSIBLE_REPO: replace_with_ansible_repo
# Added swid_tools_repo for installing swid-tools and dnf-plugin-swidtags packages
# which are essentially required for generating swid tags in RHEL8 content host.
# SWID_TOOLS_REPO: replace_with_swid_tools_repo
62 changes: 62 additions & 0 deletions conf/robottelo.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
ROBOTTELO:
# The directory where screenshots will be saved.
# Note:- Content under /tmp may be deleted after a reboot.
SCREENSHOTS_PATH: /tmp/robottelo/screenshots/
LOCALE: en_US.UTF-8
# Update upstream=false for downstream run
UPSTREAM: false
# Logging verbosity, one of debug, info, warning, error, critical
VERBOSITY: debug
# Directory for temporary files
TMP_DIR: /var/tmp
# Web Server to provide various test artifacts
# ARTIFACTS_SERVER: replace-with-artifacts-server
# Webdriver logging options
# A list of commands to be logged
LOG_DRIVER_COMMANDS:
- newSession
- windowMaximize
- get
- findElement
- sendKeysToElement
- clickElement
- mouseMoveTo
# - The URL of container hosting repos on SatLab
# Example url - http://<container_hostname_or_ip>:<port>
# Use https://github.com/SatelliteQE/fedorapeople-repos to deploy and configure the repos hosting container
# REPOS_HOSTING_URL: replace-with-repo-hosting-url
# browser tells robottelo which browser to use when testing UI. Valid values
# are:
# * selenium
# * docker: to use a browser inside a docker container. In order to use this
# feature make sure that the docker daemon is running locally and has its
# unix socket published at unix://var/run/docker.sock. Also make sure that
# the docker image selenium/standalone-firefox is available.
# * remote: to access the remote browser, the webdriver and command_executor
# are required.
BROWSER: selenium
# Webdriver to use. Valid values are chrome, firefox, ie, edge, phantomjs
WEBDRIVER: chrome
# Run browser for UI tests with semicolon delimeted options such as headless. Currently supported for only chrome.
# BROWSEROPTIONS: replace-with-browser-options
# The base DesiredCapabilities dict will be get by the browser
# specified by webdriver config. If you override browserName then that
# browser will be used instead.
# WEBDRIVER_DESIRED_CAPABILITIES:
# PLATFORM:
# MAXDURATION:
# IDLETIMEOUT:
# START-MAXIMISED:
# SCREENRESOLUTION:
# TAGS:
# Binary location for selected wedriver (not needed if using saucelabs)
# WEBDRIVER_BINARY: /usr/bin/firefox
# webdriver_binary=/usr/bin/chromedriver
# webdriver_binary=C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe
WEBDRIVER_BINARY: /usr/bin/chromedriver
# Zalenium command_executor
# COMMAND_EXECUTOR: http://127.0.0.1:4444/wd/hub
# CDN sync
CDN: true
# Run one datapoint or multiple datapoints for tests
RUN_ONE_DATAPOINT: false
27 changes: 27 additions & 0 deletions conf/server.yaml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SERVER:
# Server hostname
# HOSTNAME: replace-with-satellite-hostname
# HTTP scheme when building the server URL
# Suggested values for "scheme" are "http" and "https".
SCHEME: https
# Server port
PORT: 443
# SSH username
SSH_USERNAME: root
# Use either of SSH_PASSWORD or SSH_KEY or SSH_KEY_STRING below
# SSH password if not using a SSH key to connect
# SSH_PASSWORD: replace-with-ssh-passwd
# Path to private ssh key to be used when connecting via SSH.
# SSH_KEY:
# private ssh key as a string to be used when connecting via SSH.
# SSH_KEY_STRING:
# Admin username when accessing API and UI
ADMIN_USERNAME: admin
# Admin password when accessing API and UI
ADMIN_PASSWORD: changeme

SSH_CLIENT:
# Time to wait for the ssh command to finish, in seconds
COMMAND_TIMEOUT: 300
# Time to wait for establishing the ssh connection, in seconds
CONNECTION_TIMEOUT: 10
4 changes: 2 additions & 2 deletions pytest_fixtures/xdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def align_xdist_satellites(worker_id):
"""Set a different Satellite per worker when available in robottelo's config"""
settings.configure()
settings.server.hostname = settings.server.get_hostname(worker_id)
settings._configure_entities()
settings._configure_airgun()
settings.configure_nailgun()
settings.configure_airgun()
139 changes: 0 additions & 139 deletions robottelo.properties.sample
Original file line number Diff line number Diff line change
@@ -1,143 +1,4 @@
# Make a copy of this file named robottelo.properties
[server]
# Server hostname
hostname=
# Additional satellite hostnames for xdist workers
# gw0=
# gw1=
# gw2=

# Path to private ssh key to be used when connecting via SSH.
ssh_key=

# HTTP scheme when building the server URL
# Suggested values for "scheme" are "http" and "https".
# scheme=https

# Server port
# port=443

# SSH username
# ssh_username=root

# SSH password if not using a SSH key to connect
# ssh_password=

# Admin username when accessing API and UI
# admin_username=admin

# Admin password when accessing API and UI
# admin_password=changeme

# section for ssh client settings
# [ssh_client]
# Time to wait for the ssh command to finish, in seconds
# command_timeout=300
# Time to wait for establishing the ssh connection, in seconds
# connection_timeout=10

# Override robottelo configuration
[robottelo]
# The directory where screenshots will be saved.
# Note:- Content under /tmp may be deleted after a reboot.
# screenshots_path=/tmp/robottelo/screenshots/
# locale=en_US.UTF-8
# Update upstream=false for downstream run
# upstream=true
# Logging verbosity, one of debug, info, warning, error, critical
# verbosity=debug
# Directory for temporary files
# tmp_dir=/var/tmp
# Web Server to provide various test artifacts
# artifacts_server=server.example.com
# Webdriver logging options
# A list of commands to be logged
# log_driver_commands=newSession,windowMaximize,get,findElement,sendKeysToElement,clickElement,mouseMoveTo
# - The URL of container hosting repos on SatLab
# Example url - http://<container_hostname_or_ip>:<port>
# Use https://github.com/SatelliteQE/fedorapeople-repos to deploy and configure the repos hosting container
# repos_hosting_url=

# browser tells robottelo which browser to use when testing UI. Valid values
# are:
# * selenium
# * docker: to use a browser inside a docker container. In order to use this
# feature make sure that the docker daemon is running locally and has its
# unix socket published at unix://var/run/docker.sock. Also make sure that
# the docker image selenium/standalone-firefox is available.
# * saucelabs: makes robottelo run tests on SauceLabs. The saucelabs_user and
# saucelabs_key are required and the browser used is the same specified on
# webdriver. Supported values for webdriver are firefox, chrome and ie, the
# other valid webdriver values are going to be translated to firefox.
# * remote: to access the remote browser, the webdriver and command_executor
# are required.
# browser=selenium

# Webdriver to use. Valid values are chrome, firefox, ie, edge, phantomjs
# webdriver=chrome

# Run browser for UI tests with semicolon delimeted options such as headless. Currently supported for only chrome.
# browseroptions=

# Binary location for selected wedriver (not needed if using saucelabs)
# webdriver_binary=/usr/bin/firefox
# webdriver_binary=/usr/bin/chromedriver
# webdriver_binary=C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe

# webdriver_desired_capabilities accepts extra configuration to be passed to
# saucelabs in order to configure the test options. You can use the platform
# configurator (see link below) to get the information about the environment
# you want to test.
# https://wiki.saucelabs.com/display/DOCS/Platform+Configurator/
# Or you can visit
# https://wiki.saucelabs.com/display/DOCS/Test+Configuration+Options for a
# complete set of options.
# PS.: the base DesiredCapabilities dict will be get by the browser
# specified by webdriver config. If you override browserName then that
# browser will be used instead.
# examples:
# (note: version=<browser version>)
# webdriver_desired_capabilities=platform=OS X 10.9,version=45.0,build=myBuildName,parentTunnel=otherUser,seleniumVersion=2.48.0
# webdriver_desired_capabilities=platform=macOS 10.12,version=45.0,build=myBuildName,seleniumVersion=2.48.0,screenResolution=1600x1200
# webdriver_desired_capabilities=platform=Windows 10,version=14.14393,build=myBuildName,seleniumVersion=2.48.0,screenResolution=1600x1200
# webdriver_desired_capabilities=platform=Linux,browserName=chrome,unhandledPromptBehavior=dismiss,unexpectedAlertBehaviour=ignore,acceptInsecureCerts=True
# command_executor=http://127.0.0.1:4444/wd/hub

# saucelabs_user=
# saucelabs_key=

# cdn=true
# Run one datapoint or multiple datapoints for tests
# run_one_datapoint=false

# Provide link to rhel6/7 repo here, as puppet rpm would require packages from
# RHEL 6/7 repo and syncing the entire repo on the fly would take longer for
# tests to run Specify the *.repo link to an internal repo for tests to execute
# properly
# rhel6_repo=http://example.com/yum/repo_files/rhel6-updates.repo
# rhel7_repo=http://example.com/yum/repo_files/rhel7-updates.repo
# rhel8_repo=http://example.com/yum/repo_files/rhel8-updates.repo

# Provide link to rhel6/7 repositories URL as we need all OS packages in order
# to have real installation media for provisioning procedure
# rhel6_os=http://example.com/yum/rhel6-os/
# rhel7_os=http://example.com/yum/rhel7-os/

# RHEL 8 repos
# rhel8_os=baseos=http://example.com/rhel-8/BaseOS/x86_64/os/,appstream=http://example.com/rhel-8/AppStream/x86_64/os/


# If capsule and satellite tools repositories available related packages will
# be pulled from there instead of using the CDN channel. These information is
# more suited to be used for downstream, downstream-iso and zstream builds.
# capsule_repo=http://capsule/repo
# sattools_repo=
# rhel6=http://sattools/repo/el6,
# rhel7=http://sattools/repo/el7,

# Added swid_tools_repo for installing swid-tools and dnf-plugin-swidtags packages
# which are essentially required for generating swid tags in RHEL8 content host.
# swid_tools_repo=https://example.com/swid-rhel-8.repo

# Broker-specific settings
# [broker]
Expand Down
8 changes: 4 additions & 4 deletions robottelo/cli/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1971,9 +1971,9 @@ def setup_org_for_a_rh_repo(options=None, force_manifest_upload=False, force_use
"""
custom_repo_url = None
if options.get('repository') == REPOS['rhst6']['name']:
custom_repo_url = settings.sattools_repo['rhel6']
custom_repo_url = settings.sattools_repo.rhel6
elif options.get('repository') == REPOS['rhst7']['name']:
custom_repo_url = settings.sattools_repo['rhel7']
custom_repo_url = settings.sattools_repo.rhel7
elif options.get('repository') == REPOS['rhel6']['name']:
custom_repo_url = settings.rhel6_os
elif options.get('repository') == REPOS['rhel7']['name']:
Expand Down Expand Up @@ -2658,8 +2658,8 @@ def virt_who_hypervisor_config(
'repository-set': REPOSET['rhst7'],
'repository': REPOS['rhst7']['name'],
'repository-id': REPOS['rhst7']['id'],
'url': settings.sattools_repo['rhel7'],
'cdn': bool(settings.cdn or not settings.sattools_repo['rhel7']),
'url': settings.sattools_repo.rhel7,
'cdn': bool(settings.cdn or not settings.sattools_repo.rhel7),
}
]
repos.extend(extra_repos)
Expand Down
5 changes: 5 additions & 0 deletions robottelo/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from robottelo.config.facade import SettingsFacade
from robottelo.config.facade import SettingsNodeWrapper


logger = logging.getLogger('robottelo.config')

legacy_settings = LegacySettings()
Expand Down Expand Up @@ -46,3 +47,7 @@
settings_proxy.set_configs(dynaconf_settings, legacy_settings)

settings = SettingsNodeWrapper(settings_proxy)
settings.configure_nailgun()
settings.configure_airgun()
settings.configure_logging()
settings.configure_third_party_logging()
Loading

0 comments on commit a33f706

Please sign in to comment.