From b3625b9996d283b21e6121e95220708afbe7bdff Mon Sep 17 00:00:00 2001 From: Ayush Ujjwal <77244483+aujjwal-redhat@users.noreply.github.com> Date: Thu, 22 Apr 2021 18:44:23 +0530 Subject: [PATCH] Renamed support to common and handled the imports and md file references (#215) * Renamed support to common * Modified imports in various files * Modified references in .md files Fixes : #213 Signed-off-by: aujjwal-redhat --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- .github/workflows/linting.yml | 2 +- README.md | 2 +- {support => common}/__init__.py | 0 {support => common}/logging.md | 0 {support => common}/mixin.md | 6 +++--- common/mixin.py | 18 ++++++++++++++++++ {support => common}/ops/OPS_README.md | 0 {support => common}/ops/__init__.py | 0 {support => common}/ops/abstract_ops.py | 0 .../ops/gluster_ops/__init__.py | 0 .../ops/gluster_ops/gluster_ops.py | 2 +- .../ops/gluster_ops/peer_ops.py | 2 +- .../ops/gluster_ops/volume_ops.py | 2 +- .../ops/support_ops/__init__.py | 0 {support => common}/ops/support_ops/io_ops.py | 2 +- {support => common}/relog.py | 0 {support => common}/rexe.py | 0 core/redant_main.py | 2 +- support/mixin.py | 18 ------------------ tests/parent_test.py | 2 +- tools/linting.sh | 6 +++--- 22 files changed, 33 insertions(+), 33 deletions(-) rename {support => common}/__init__.py (100%) rename {support => common}/logging.md (100%) rename {support => common}/mixin.md (94%) create mode 100644 common/mixin.py rename {support => common}/ops/OPS_README.md (100%) rename {support => common}/ops/__init__.py (100%) rename {support => common}/ops/abstract_ops.py (100%) rename {support => common}/ops/gluster_ops/__init__.py (100%) rename {support => common}/ops/gluster_ops/gluster_ops.py (99%) rename {support => common}/ops/gluster_ops/peer_ops.py (99%) rename {support => common}/ops/gluster_ops/volume_ops.py (99%) rename {support => common}/ops/support_ops/__init__.py (100%) rename {support => common}/ops/support_ops/io_ops.py (94%) rename {support => common}/relog.py (100%) rename {support => common}/rexe.py (100%) delete mode 100644 support/mixin.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 1077989af..76b37a246 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -15,7 +15,7 @@ Contributing Conventions: 1. Include descriptive PR titles with [] prepended. 2. Build and test your changes before submitting a PR. -3. If logging then check the logging.md file in ops/support_ops +3. If logging then check the logging.md file in common/ 4. Remember to check the linting issues beforehand as well to prevent your checks from failing. 5. Remember to sign-off your commits diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 6d61e8c30..9d47b76f4 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -28,6 +28,6 @@ jobs: - name: Lint with Pylint run: | pylint $(pwd)/core/ - pylint $(pwd)/support/ + pylint $(pwd)/common/ pylint $(pwd)/tests/ diff --git a/README.md b/README.md index d322f65f5..a905084f9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Design Doc Link : [Gluster-test Design-doc](https://docs.google.com/document/d/1 ### Structure: core: contains the core redant framework which includes parsing,test_list_builder,test_runner,runner_thread and redant_main.
-support: consists of the libs and ops that will help in running the test cases and the mixin class.
+common: consists of the libs and ops that will help in running the test cases and the mixin class.
tests: holds the test cases as performace and functional tests and includes parent test. Add any new test cases here.
### To start Working: diff --git a/support/__init__.py b/common/__init__.py similarity index 100% rename from support/__init__.py rename to common/__init__.py diff --git a/support/logging.md b/common/logging.md similarity index 100% rename from support/logging.md rename to common/logging.md diff --git a/support/mixin.md b/common/mixin.md similarity index 94% rename from support/mixin.md rename to common/mixin.md index cf1bc9e63..ed5aa505d 100644 --- a/support/mixin.md +++ b/common/mixin.md @@ -69,9 +69,9 @@ Once the above support library is created, one needs to add the module inside th let the `mixin` class inherit from this newly added class. ``` -from support.ops.support_ops.rexe import Rexe -from support.ops.gluster_ops.sample_ops1 import sample_ops_class # the newly added module -from support.ops.gluster_ops.sample_ops2 import sample_ops2_class +from common.ops.support_ops.rexe import Rexe +from common.ops.gluster_ops.sample_ops1 import sample_ops_class # the newly added module +from common.ops.gluster_ops.sample_ops2 import sample_ops2_class class mixin(Rexe, sample_ops_class, sample_ops2_class): pass diff --git a/common/mixin.py b/common/mixin.py new file mode 100644 index 000000000..5b0ba6745 --- /dev/null +++ b/common/mixin.py @@ -0,0 +1,18 @@ +""" + Module Name: + Purpose: Refer to the redhat_mixin.md for more information +""" +from common.rexe import Rexe +from common.relog import Logger +from common.ops.support_ops.io_ops import IoOps +from common.ops.gluster_ops.peer_ops import PeerOps +from common.ops.gluster_ops.volume_ops import VolumeOps +from common.ops.gluster_ops.gluster_ops import GlusterOps + + +class RedantMixin(GlusterOps, VolumeOps, PeerOps, IoOps, Rexe, Logger): + """ + A mixin class for redant project to encompass all ops and support + modules. + """ + pass diff --git a/support/ops/OPS_README.md b/common/ops/OPS_README.md similarity index 100% rename from support/ops/OPS_README.md rename to common/ops/OPS_README.md diff --git a/support/ops/__init__.py b/common/ops/__init__.py similarity index 100% rename from support/ops/__init__.py rename to common/ops/__init__.py diff --git a/support/ops/abstract_ops.py b/common/ops/abstract_ops.py similarity index 100% rename from support/ops/abstract_ops.py rename to common/ops/abstract_ops.py diff --git a/support/ops/gluster_ops/__init__.py b/common/ops/gluster_ops/__init__.py similarity index 100% rename from support/ops/gluster_ops/__init__.py rename to common/ops/gluster_ops/__init__.py diff --git a/support/ops/gluster_ops/gluster_ops.py b/common/ops/gluster_ops/gluster_ops.py similarity index 99% rename from support/ops/gluster_ops/gluster_ops.py rename to common/ops/gluster_ops/gluster_ops.py index 0ab0f3dcd..e92d2e0a6 100644 --- a/support/ops/gluster_ops/gluster_ops.py +++ b/common/ops/gluster_ops/gluster_ops.py @@ -3,7 +3,7 @@ operations on the glusterd service on the server or the client. """ -from support.ops.abstract_ops import AbstractOps +from common.ops.abstract_ops import AbstractOps class GlusterOps(AbstractOps): diff --git a/support/ops/gluster_ops/peer_ops.py b/common/ops/gluster_ops/peer_ops.py similarity index 99% rename from support/ops/gluster_ops/peer_ops.py rename to common/ops/gluster_ops/peer_ops.py index 021028c8e..208665017 100644 --- a/support/ops/gluster_ops/peer_ops.py +++ b/common/ops/gluster_ops/peer_ops.py @@ -5,7 +5,7 @@ """ import socket -from support.ops.abstract_ops import AbstractOps +from common.ops.abstract_ops import AbstractOps class PeerOps(AbstractOps): """ diff --git a/support/ops/gluster_ops/volume_ops.py b/common/ops/gluster_ops/volume_ops.py similarity index 99% rename from support/ops/gluster_ops/volume_ops.py rename to common/ops/gluster_ops/volume_ops.py index dfec1ee0a..b77f17d1a 100644 --- a/support/ops/gluster_ops/volume_ops.py +++ b/common/ops/gluster_ops/volume_ops.py @@ -3,7 +3,7 @@ holds volume related APIs which will be called from the test case. """ -from support.ops.abstract_ops import AbstractOps +from common.ops.abstract_ops import AbstractOps class VolumeOps(AbstractOps): diff --git a/support/ops/support_ops/__init__.py b/common/ops/support_ops/__init__.py similarity index 100% rename from support/ops/support_ops/__init__.py rename to common/ops/support_ops/__init__.py diff --git a/support/ops/support_ops/io_ops.py b/common/ops/support_ops/io_ops.py similarity index 94% rename from support/ops/support_ops/io_ops.py rename to common/ops/support_ops/io_ops.py index e93840563..7839e03f3 100644 --- a/support/ops/support_ops/io_ops.py +++ b/common/ops/support_ops/io_ops.py @@ -2,7 +2,7 @@ This file contains one class - IoOps which holds API for running all the IO commands. """ -from support.ops.abstract_ops import AbstractOps +from common.ops.abstract_ops import AbstractOps class IoOps(AbstractOps): diff --git a/support/relog.py b/common/relog.py similarity index 100% rename from support/relog.py rename to common/relog.py diff --git a/support/rexe.py b/common/rexe.py similarity index 100% rename from support/rexe.py rename to common/rexe.py diff --git a/core/redant_main.py b/core/redant_main.py index e5f628f15..2cffc8eb6 100644 --- a/core/redant_main.py +++ b/core/redant_main.py @@ -72,7 +72,7 @@ def main(): # Creating log dirs. sys.path.insert(1, ".") - from support.relog import Logger + from common.relog import Logger args.log_dir = f'{args.log_dir}/{datetime.datetime.now()}' Logger.log_dir_creation(args.log_dir, test_cases_component, test_cases_dict) diff --git a/support/mixin.py b/support/mixin.py deleted file mode 100644 index 495c1b277..000000000 --- a/support/mixin.py +++ /dev/null @@ -1,18 +0,0 @@ -""" - Module Name: - Purpose: Refer to the redhat_mixin.md for more information -""" -from support.rexe import Rexe -from support.relog import Logger -from support.ops.support_ops.io_ops import IoOps -from support.ops.gluster_ops.peer_ops import PeerOps -from support.ops.gluster_ops.volume_ops import VolumeOps -from support.ops.gluster_ops.gluster_ops import GlusterOps - - -class RedantMixin(GlusterOps, VolumeOps, PeerOps, IoOps, Rexe, Logger): - """ - A mixin class for redant project to encompass all ops and support - modules. - """ - pass diff --git a/tests/parent_test.py b/tests/parent_test.py index 8272b93ac..a87bf7f30 100644 --- a/tests/parent_test.py +++ b/tests/parent_test.py @@ -1,6 +1,6 @@ import traceback import abc -from support.mixin import RedantMixin +from common.mixin import RedantMixin from datetime import datetime diff --git a/tools/linting.sh b/tools/linting.sh index 8b961c25b..7df2f0a3f 100755 --- a/tools/linting.sh +++ b/tools/linting.sh @@ -10,9 +10,9 @@ perform_linting () { pylint -j 4 --rcfile=.pylintrc ./tests/example/sample_component pylint -j 4 --rcfile=.pylintrc ./tests/functional pylint -j 4 --rcfile=.pylintrc ./tests/functional/glusterd - pylint -j 4 --rcfile=.pylintrc ./support - pylint -j 4 --rcfile=.pylintrc ./support/ops/gluster_ops - pylint -j 4 --rcfile=.pylintrc ./support/ops/support_ops + pylint -j 4 --rcfile=.pylintrc ./common + pylint -j 4 --rcfile=.pylintrc ./common/ops/gluster_ops + pylint -j 4 --rcfile=.pylintrc ./common/ops/support_ops else pylint -j 4 --rcfile=.pylintrc $FILEPATH fi