From 35772adee66b2f8643395f458208d70a60a9df79 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:26:43 -0400 Subject: [PATCH 01/12] Tox and setup fixes --- .tox/dist/robotframework-profiler-1.0.0.zip | Bin 0 -> 6466 bytes .travis.yml | 11 ----------- requirements.txt | 4 +--- requirements/common.txt | 2 ++ requirements/dev.txt | 3 +++ requirements/prod.txt | 1 + setup.py | 10 ++++++---- .../profiler/debug_keywords.py | 9 +++++---- tox.ini | 10 ++++++++++ 9 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 .tox/dist/robotframework-profiler-1.0.0.zip delete mode 100644 .travis.yml create mode 100644 requirements/common.txt create mode 100644 requirements/dev.txt create mode 100644 requirements/prod.txt create mode 100644 tox.ini diff --git a/.tox/dist/robotframework-profiler-1.0.0.zip b/.tox/dist/robotframework-profiler-1.0.0.zip new file mode 100644 index 0000000000000000000000000000000000000000..5ee952b1adf3bfafe1aa908fbb5e39497520553f GIT binary patch literal 6466 zcmeHLc|4SB8y;)2M3(I0lo(@enovac-I&P|GGT^<8OB(~l7^&0)}o@a9Tl?gDI8fx zV=4PCrN|!Yq`sLtMe-f}&euQR?|0t$Ju~kg^IX?`zt8*J_jNr`eHvO$0Oh*mGXnj5 z^VgRU`4@|^!{8jSwyr2|4Axo74U2JbazSCGRe8o)vGQT|A08^_Vqmda0uGx#N_SDI<;V)x(cpYh- z1@>fKu#10cP_7%Ksn-d7uq;vEfX5Q7s~?+vN^@d$k=}bLidj<2XWBW_+JuTSB>6df(ksFEsL$CDIdYsH#e;-d-`$`NfBu{Oeqd$cA_bJgk0Yo*+sm7R<`Xj9jhVsv*UrdVgV zT|~Pkp}UkdMWCFwNh&+vwMh8raNY+rQltL-h-{XiN}A+H7WBcF_4Unp7K7{_)w*oA zlCB68z+rr`5tCC>%)2I(yRMB!j`dj;VTtB$<#j>&yN!IU!)_~NE{j{Ey~hyc%rYhZttUn5#OvD{Y zX*Tf>5W7#ybqnM%kRJ8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HSVBW5DIjqh{&N2+#x=h~R{#xAu+e)-psuj^SGxi@x+ eHSSC7za;VRdInUVj-JB6O8y9t@7O4I4)7l^`Y3<^ literal 0 HcmV?d00001 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6adeddc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: python - -python: - - "2.7" - - "3.8" - -install: - - "pip install -r requirements.txt" - -script: - - robot -P src tests \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7e69784..3e2d68e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1 @@ -robotframework -pyotp -pyyaml +-r requirements/prod.txt \ No newline at end of file diff --git a/requirements/common.txt b/requirements/common.txt new file mode 100644 index 0000000..e4e5568 --- /dev/null +++ b/requirements/common.txt @@ -0,0 +1,2 @@ +robotframework +pyyaml \ No newline at end of file diff --git a/requirements/dev.txt b/requirements/dev.txt new file mode 100644 index 0000000..49bfff1 --- /dev/null +++ b/requirements/dev.txt @@ -0,0 +1,3 @@ +-r common.txt + +tox \ No newline at end of file diff --git a/requirements/prod.txt b/requirements/prod.txt new file mode 100644 index 0000000..c3899b0 --- /dev/null +++ b/requirements/prod.txt @@ -0,0 +1 @@ +-r common.txt \ No newline at end of file diff --git a/setup.py b/setup.py index 6e9ad0b..e8a2096 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,17 @@ #!/usr/bin/env python import re +import os from os.path import abspath, dirname, join from setuptools import setup CURDIR = dirname(abspath(__file__)) REQUIREMENTS = ['robotframework >= 3.0'] -with open(join(CURDIR, 'src', 'version.py')) as f: +with open(join(CURDIR, 'src', 'formulated_automation', 'version.py')) as f: VERSION = re.search("^VERSION = '(.*)'", f.read()).group(1) -with open(join(CURDIR, 'README.rst')) as f: +with open(join(CURDIR, 'README.rst'), encoding='utf-8') as f: DESCRIPTION = f.read() +print(dir(os.listdir(CURDIR))) CLASSIFIERS = ''' Development Status :: 5 - Production/Stable License :: OSI Approved :: Apache Software License @@ -35,6 +37,6 @@ platforms='any', classifiers=CLASSIFIERS, install_requires=REQUIREMENTS, - package_dir={'': 'src/FormulatedAutomation'}, - packages=['Profiler'] + package_dir={'': 'src'}, + packages=['formulated_automation'] ) diff --git a/src/formulated_automation/profiler/debug_keywords.py b/src/formulated_automation/profiler/debug_keywords.py index 1d5ae3c..b304362 100644 --- a/src/formulated_automation/profiler/debug_keywords.py +++ b/src/formulated_automation/profiler/debug_keywords.py @@ -12,10 +12,11 @@ class Debug: def __init__(self): self.__imported_required_libraries = False - # Let's us call 'Set Breakpoint' anyhwere in our robot framework code. - # Will drop to `pdb` at which point we can run anything we like from - # python interpreter def set_breakpoint(self): + """ Let's us call 'Set Breakpoint' anyhwere in our robot framework code. + Will drop to `pdb` at which point we can run anything we like from + python interpreter + """ if self.__is_debug_mode(): #pylint: disable=import-outside-toplevel import sys @@ -57,7 +58,7 @@ def _print_envs(self): # set to TRUE This prevents us from accidentally setting a breakpoint and # launching it in production def __is_debug_mode(self): - return os.environ['ROBOT_DEBUG'] == 'TRUE' + return os.getenv('ROBOT_DEBUG', 'FALSE') == 'TRUE' # In order to use "Pause Execution" we need to import Dialog def __import_required_libraries(self): diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..46c86d2 --- /dev/null +++ b/tox.ini @@ -0,0 +1,10 @@ +# content of: tox.ini , put in same dir as setup.py +[tox] +envlist = py38 +[testenv] +# install testing framework +# ... or install anything else you might need here +deps = -rrequirements/dev.txt +# run the tests +# ... or run any other command line tool you need to run here +commands = robot -P src tests \ No newline at end of file From 7b2a2127f7cb914005033ce4a50da58c18c1f70b Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:33:05 -0400 Subject: [PATCH 02/12] Ignore .Tox, add CircleCI config --- .circleci/config.yml | 10 ++++++++++ .gitignore | 4 +++- .tox/dist/robotframework-profiler-1.0.0.zip | Bin 6466 -> 0 bytes 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .circleci/config.yml delete mode 100644 .tox/dist/robotframework-profiler-1.0.0.zip diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..80e78cd --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,10 @@ +version: 2.1 +jobs: + build: + docker: + - image: circleci/python:3.6.2-stretch-browsers + steps: + - checkout + - python/load-cache + - python/save-cache + - run: pip install -r requirements/dev.txt \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7ecc345..6d86344 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ __pycache__/ *.egg-info # Allow symlink to docs -!/index.html \ No newline at end of file +!/index.html + +.tox \ No newline at end of file diff --git a/.tox/dist/robotframework-profiler-1.0.0.zip b/.tox/dist/robotframework-profiler-1.0.0.zip deleted file mode 100644 index 5ee952b1adf3bfafe1aa908fbb5e39497520553f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6466 zcmeHLc|4SB8y;)2M3(I0lo(@enovac-I&P|GGT^<8OB(~l7^&0)}o@a9Tl?gDI8fx zV=4PCrN|!Yq`sLtMe-f}&euQR?|0t$Ju~kg^IX?`zt8*J_jNr`eHvO$0Oh*mGXnj5 z^VgRU`4@|^!{8jSwyr2|4Axo74U2JbazSCGRe8o)vGQT|A08^_Vqmda0uGx#N_SDI<;V)x(cpYh- z1@>fKu#10cP_7%Ksn-d7uq;vEfX5Q7s~?+vN^@d$k=}bLidj<2XWBW_+JuTSB>6df(ksFEsL$CDIdYsH#e;-d-`$`NfBu{Oeqd$cA_bJgk0Yo*+sm7R<`Xj9jhVsv*UrdVgV zT|~Pkp}UkdMWCFwNh&+vwMh8raNY+rQltL-h-{XiN}A+H7WBcF_4Unp7K7{_)w*oA zlCB68z+rr`5tCC>%)2I(yRMB!j`dj;VTtB$<#j>&yN!IU!)_~NE{j{Ey~hyc%rYhZttUn5#OvD{Y zX*Tf>5W7#ybqnM%kRJ8?WKapg+e2846@C7YD=2ZvQ;Jtt;tXqPNnr3xSN3bxOC60U z;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C7za;VRdInUVj-JB6O8y9t@7O4I4)7l^`Y3<^ From eb1ff7d749dcb40f7a76bb73e491bf7af781c412 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:38:38 -0400 Subject: [PATCH 03/12] Use the Python Orb --- .circleci/config.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 80e78cd..1ce7547 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,10 +1,15 @@ version: 2.1 + +orbs: + python: circleci/python@0.2.1 + jobs: - build: - docker: - - image: circleci/python:3.6.2-stretch-browsers + build-and-test: + executor: python/default steps: - checkout - python/load-cache + - run: + command: pip install -r requirements/dev.txt + name: Install Deps - python/save-cache - - run: pip install -r requirements/dev.txt \ No newline at end of file From 9be866793f7426b4ed6b131b276b630b44fa2a7f Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:40:23 -0400 Subject: [PATCH 04/12] Yaml fix --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ce7547..9256eb2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,6 @@ jobs: - checkout - python/load-cache - run: - command: pip install -r requirements/dev.txt - name: Install Deps + command: pip install -r requirements/dev.txt + name: Install Deps - python/save-cache From f77da2ad79f1a7c768742cecc95c2034e430f05f Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:41:11 -0400 Subject: [PATCH 05/12] Eventually --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9256eb2..1a0453f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ orbs: python: circleci/python@0.2.1 jobs: - build-and-test: + build: executor: python/default steps: - checkout From 4b58d6f1b54bea1a6b8458be23de09e5a5100018 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:49:43 -0400 Subject: [PATCH 06/12] Specify output, fix circle --- .circleci/config.yml | 36 ++++++++++++++++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a0453f..e2e5051 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,6 +5,7 @@ orbs: jobs: build: + executor: python/default steps: - checkout @@ -13,3 +14,38 @@ jobs: command: pip install -r requirements/dev.txt name: Install Deps - python/save-cache + + +version: 2 +jobs: + build: + docker: + - image: circleci/python:3.6.2-stretch-browsers + environment: + FLASK_CONFIG: testing + TEST_DATABASE_URL: postgresql://ubuntu@localhost/circle_test?sslmode=disable + - image: circleci/postgres:9.6.5-alpine-ram + environment: + POSTGRES_USER: ubuntu + POSTGRES_DB: circle_test + POSTGRES_PASSWORD: "" + steps: + - checkout + - restore_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }} + - run: + name: Install Python deps in a venv + command: | + python3 -m venv venv + . venv/bin/activate + pip install -r requirements/dev.txt + - save_cache: + key: deps1-{{ .Branch }}-{{ checksum "requirements/dev.txt" }} + paths: + - "venv" + - run: + command: | + . venv/bin/activate + tox + - store_test_results: + path: output \ No newline at end of file diff --git a/tox.ini b/tox.ini index 46c86d2..8844ae3 100644 --- a/tox.ini +++ b/tox.ini @@ -7,4 +7,4 @@ envlist = py38 deps = -rrequirements/dev.txt # run the tests # ... or run any other command line tool you need to run here -commands = robot -P src tests \ No newline at end of file +commands = robot -d output -P src tests \ No newline at end of file From 3e5159ff6327887239aa392742d3d00351876038 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:50:27 -0400 Subject: [PATCH 07/12] Circle fix --- .circleci/config.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e2e5051..3a31fb3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,21 +1,3 @@ -version: 2.1 - -orbs: - python: circleci/python@0.2.1 - -jobs: - build: - - executor: python/default - steps: - - checkout - - python/load-cache - - run: - command: pip install -r requirements/dev.txt - name: Install Deps - - python/save-cache - - version: 2 jobs: build: From dfd9ddc3414104b585d0558c8a235aebd9564d0b Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 15:53:04 -0400 Subject: [PATCH 08/12] Copy pasta --- .circleci/config.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a31fb3..192eec5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,15 +2,7 @@ version: 2 jobs: build: docker: - - image: circleci/python:3.6.2-stretch-browsers - environment: - FLASK_CONFIG: testing - TEST_DATABASE_URL: postgresql://ubuntu@localhost/circle_test?sslmode=disable - - image: circleci/postgres:9.6.5-alpine-ram - environment: - POSTGRES_USER: ubuntu - POSTGRES_DB: circle_test - POSTGRES_PASSWORD: "" + - image: circleci/python:3.8 steps: - checkout - restore_cache: From 0f344d1cd59e66b587d4ed28a1d9595f0066c1a8 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 16:03:49 -0400 Subject: [PATCH 09/12] Cleanup file write, and test names, fix artifacts --- .circleci/config.yml | 2 +- src/formulated_automation/profiler/system_base.py | 4 ---- tests/test.robot | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 192eec5..a758852 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,5 +21,5 @@ jobs: command: | . venv/bin/activate tox - - store_test_results: + - store_artifacts: path: output \ No newline at end of file diff --git a/src/formulated_automation/profiler/system_base.py b/src/formulated_automation/profiler/system_base.py index 9cb5ba8..3b0373d 100644 --- a/src/formulated_automation/profiler/system_base.py +++ b/src/formulated_automation/profiler/system_base.py @@ -63,16 +63,12 @@ def _write_orderly_yaml(self, profile, outfile): with open(outfile, 'w') as f: yaml.dump({'metadata': profile['metadata']}, f, default_flow_style=False) - with open(outfile, 'a') as f: yaml.dump({'system': profile['system']}, f, default_flow_style=False) - with open(outfile, 'a') as f: yaml.dump({'variables': profile['variables']}, f, default_flow_style=False) - with open(outfile, 'a') as f: yaml.dump( {'environment_variables': profile['environment_variables']}, f, default_flow_style=False) - with open(outfile, 'a') as f: yaml.dump({'programs': profile['programs']}, f, default_flow_style=False) diff --git a/tests/test.robot b/tests/test.robot index db5de25..7eb0a89 100644 --- a/tests/test.robot +++ b/tests/test.robot @@ -12,5 +12,5 @@ Teardown Write Profile *** Test Cases *** -Get a system profile +Set a breakpoint Set Breakpoint From 3be1332ddb247f5664fa9cab389beaf07cde4665 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 16:10:48 -0400 Subject: [PATCH 10/12] Debug Circle env --- src/formulated_automation/profiler/system_base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/formulated_automation/profiler/system_base.py b/src/formulated_automation/profiler/system_base.py index 3b0373d..fbb9353 100644 --- a/src/formulated_automation/profiler/system_base.py +++ b/src/formulated_automation/profiler/system_base.py @@ -38,7 +38,9 @@ def system_environment_variables(self): def write_profile(self): """ Write out the system profile in the output directory """ output_dir = BuiltIn().get_variable_value('${OUTPUT_DIR}') + BuiltIn().log(output_dir, console=True) output_file = os.path.join(output_dir, "fa_report.yaml") + BuiltIn().log(output_file, console=True) variables = Utils.dump_collection( BuiltIn().get_variables(), secret_key_regex=self.config['secret_key_regex']) From c9869f0940a1e889e6e76a42eeeb85be6f4aaa7f Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 16:18:42 -0400 Subject: [PATCH 11/12] Windows vs Linux --- src/formulated_automation/profiler/system_base.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/formulated_automation/profiler/system_base.py b/src/formulated_automation/profiler/system_base.py index fbb9353..a3ea8f4 100644 --- a/src/formulated_automation/profiler/system_base.py +++ b/src/formulated_automation/profiler/system_base.py @@ -38,9 +38,7 @@ def system_environment_variables(self): def write_profile(self): """ Write out the system profile in the output directory """ output_dir = BuiltIn().get_variable_value('${OUTPUT_DIR}') - BuiltIn().log(output_dir, console=True) output_file = os.path.join(output_dir, "fa_report.yaml") - BuiltIn().log(output_file, console=True) variables = Utils.dump_collection( BuiltIn().get_variables(), secret_key_regex=self.config['secret_key_regex']) @@ -62,7 +60,7 @@ def _write_orderly_yaml(self, profile, outfile): top level, we want to be able to put the most important information first. """ - with open(outfile, 'w') as f: + with open(outfile, 'w+') as f: yaml.dump({'metadata': profile['metadata']}, f, default_flow_style=False) yaml.dump({'system': profile['system']}, From 471ed406969f97081ffcb483d3b4f31467d7a715 Mon Sep 17 00:00:00 2001 From: Mark Percival Date: Wed, 1 Jul 2020 16:23:53 -0400 Subject: [PATCH 12/12] Got it this time, windows handles this for some reason --- src/formulated_automation/profiler/system_base.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/formulated_automation/profiler/system_base.py b/src/formulated_automation/profiler/system_base.py index a3ea8f4..6c901ec 100644 --- a/src/formulated_automation/profiler/system_base.py +++ b/src/formulated_automation/profiler/system_base.py @@ -3,6 +3,7 @@ """ import re import os +from pathlib import Path import datetime import platform import yaml @@ -60,6 +61,9 @@ def _write_orderly_yaml(self, profile, outfile): top level, we want to be able to put the most important information first. """ + # Ensure the path exists + Path(os.path.dirname(outfile)).mkdir(parents=True, exist_ok=True) + with open(outfile, 'w+') as f: yaml.dump({'metadata': profile['metadata']}, f, default_flow_style=False)