-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new functionality to read config from pytest
And moved deployment test case to pytest
- Loading branch information
1 parent
e26af38
commit f855518
Showing
12 changed files
with
321 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
# OCS-CI | ||
# OpenShift Install | ||
|
||
OCS CI is a framework to test Red Hat OCS features and functionality using AWS | ||
and other supported platforms. The framework is based on CephCI | ||
( https://github.com/red-hat-storage/cephci ) | ||
The OpenShift installer `openshift-install` makes it easy to get a cluster | ||
running on the public cloud or your local infrastructure. | ||
|
||
Documentation is structured and available under docs directory | ||
inside this project. You can click [HERE](docs/README.md) to see | ||
the Table Of Content(TOC) of our documentation. | ||
To learn more about installing OpenShift, visit [docs.openshift.com](https://docs.openshift.com) | ||
and select the version of OpenShift you are using. | ||
|
||
## Installing the tools | ||
|
||
After extracting this archive, you can move the `openshift-install` binary | ||
to a location on your PATH such as `/usr/local/bin`, or keep it in a temporary | ||
directory and reference it via `./openshift-install`. | ||
|
||
## License | ||
|
||
OpenShift is licensed under the Apache Public License 2.0. The source code for this | ||
program is [located on github](https://github.com/openshift/installer). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
--- | ||
# This is example of the config for deployment which allows you to overwrite | ||
# the default values from templates. | ||
env_data: | ||
ENV_DATA: | ||
# take a look at deployment templates variables, here you is the place you | ||
# can overwrite all the vars you want. | ||
platform: 'aws' | ||
workers: 3 # here you can define diff number of workers | ||
workers: 6 # here you can define diff number of workers | ||
masters: 3 | ||
ceph_image: "quay.io/rhceph-dev/rhceph-4.0-rhel-8" | ||
rook_image: "quay.io/rhceph-dev/rook" | ||
rook_image: "quay.io/rhceph-dev/rook" # you can overwrite default rook image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
# This is the default configuration file which will be merged with file passed | ||
# by: | ||
# | ||
# * --ocs-conf file.yaml parameter. | ||
# * --cluster-conf cluster.yaml parameter - this will be rendered under | ||
# ENV_DATA section | ||
# | ||
# Then it will be rendered with jinja2 to be able to reuse vars defined in | ||
# different sections. The sections which are with capital letters will be | ||
# available directly in ocsci.config module. | ||
# | ||
# Please when you reuse some variable follow this convention: | ||
# ceph_image: '{{ DEFAULTS["CEPH_IMAGE"] }}' | ||
# Order of the quotas is important! Start with apostrophe like in example! | ||
# ------------------------------------------------------------------------ | ||
# This is the place for common default variables used in multiple places. | ||
# Values from this section are then available from tests from ocs.defaults | ||
# module. | ||
DEFAULTS: | ||
AWS_REGION: "us-east-2" | ||
ROOK_CLUSTER_NAMESPACE: "openshift-storage" | ||
KUBECONFIG_LOCATION: "auth/kubeconfig" # relative from cluster_dir | ||
API_VERSION: "v1" | ||
CEPH_IMAGE: "quay.io/rhceph-dev/rhceph-4.0-rhel-8" | ||
ROOK_IMAGE: "quay.io/rhceph-dev/rook" | ||
DEPLOYMENT_PLATFORM: "AWS" | ||
|
||
|
||
|
||
# in this RUN section we will keep default parameters for run of OCS-CI | ||
RUN: | ||
log_dir: "/tmp" | ||
run_id: null # this will be redefined in the execution | ||
kubeconfig_location: '{{ DEFAULTS["KUBECONFIG_LOCATION"] }}' | ||
cli_params: {} # this will be filled with CLI parameters data | ||
|
||
# In this section we are storing all deployment related configuration | ||
DEPLOYMENT: | ||
installer_version: "4.1.0-rc.3" | ||
|
||
# Section for reporting configuration | ||
REPORTING: | ||
email: | ||
address: "ocs-ci@redhat.com" | ||
|
||
# This is the default information about environment. Will be overwritten with | ||
# --cluster-conf file.yaml data you will pass to the pytest. | ||
ENV_DATA: | ||
platform: '{{ DEFAULTS["DEPLOYMENT_PLATFORM"] }}' | ||
cluster_name: "ocs-ci-cluster" # needs to be changed in ocscilib plugin | ||
cluster_namespace: '{{ DEFAULTS["ROOK_CLUSTER_NAMESPACE"] }}' | ||
region: '{{ DEFAULTS["AWS_REGION"] }}' | ||
ceph_image: '{{ DEFAULTS["CEPH_IMAGE"] }}' | ||
rook_image: '{{ DEFAULTS["ROOK_IMAGE"] }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
# TODO: Create yaml config file for defaults | ||
ocs_conf_file = "decide_path/default_config.yml" | ||
# Following config variables will be loaded by ocscilib pytest plugin. | ||
# See the conf/ocsci/default_config.yaml for default values. | ||
# The data are combined from multiple sources and then exposed to the following | ||
# variables. | ||
# | ||
# You can see the logic in pytest_customization/plugins/ocscilib.py. | ||
|
||
RUN = {} # all runtime related data | ||
DEPLOYMENT = {} # deployment related data | ||
REPORTING = {} # reporting related data | ||
ENV_DATA = {} # environment related data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
import logging | ||
import pytest | ||
|
||
from ocsci import config | ||
from ocsci.config import ENV_DATA | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@pytest.mark.run_this | ||
def test_not_run_me_fail_pass(): | ||
logger.info("Hey from test which should pass") | ||
# This is just example, we will need to load config data and access them | ||
# directly, this is just example how we can access and share this config | ||
# in all the tests | ||
logger.info(f"Conf file is: {config.ocs_conf_file}") | ||
logger.info( | ||
"You can easily access data from ENV_DATA like cluster_name: %s", | ||
ENV_DATA['cluster_name'] | ||
) | ||
assert 1 == 1, "This will not reach this message" | ||
|
||
|
||
# Not applying this marker if you call py.test -m run_this this test won't be | ||
# executed | ||
# @pytest.mark.run_this | ||
def test_not_run_me_fail(): | ||
logger.info("Hey from test which should pass") | ||
assert 1 == 0, "This will fail and print this message cause of 1 != 0" |
Oops, something went wrong.