2022.6 #88

Merged
edraft merged 158 commits from 2022.6 into master 2022-06-29 17:50:07 +02:00
6 changed files with 25 additions and 15 deletions
Showing only changes of commit a72dd0dc2e - Show all commits

View File

@ -15,14 +15,20 @@
},
"Scripts": {
"hello-world": "echo 'Hello World'",
"sv": "cpl set-version",
"set-version": "cpl run set-version $ARGS; echo '';",
"spu": "cpl set-pip-urls",
"set-pip-urls": "cpl run set-pip-urls $ARGS; echo '';",
"docs-build": "echo 'Build Documentation'; cd docs/; sphinx-apidoc -o source/ ../src/cpl_core; sphinx-apidoc -o source/ ../src/cpl_query; make clean; make html; rm source/cpl_query.tests.rst;",
"db": "cpl build-docs",
"docs-open": "xdg-open $PWD/docs/build/html/index.html &",
"do": "cpl docs-open",
"test": "cpl run unittests",
"pre-build-all": "cpl sv $ARGS; cpl spu $ARGS;",
"build-all": "cpl build-cli; cpl build-core; cpl build-query; cpl build-set-pip-urls; cpl build-set-version",
"ba": "cpl build-all $ARGS",
@ -31,12 +37,14 @@
"build-query": "echo 'Build cpl-query'; cd ./src/cpl_query; cpl build; cd ../../;",
"build-set-pip-urls": "echo 'Build set-pip-urls'; cd ./tools/set_pip_urls; cpl build; cd ../../;",
"build-set-version": "echo 'Build set-version'; cd ./tools/set_version; cpl build; cd ../../;",
"pre-publish-all": "cpl sv $ARGS; cpl spu $ARGS;",
"publish-all": "cpl publish-cli; cpl publish-core; cpl publish-query;",
"pa": "cpl build-all $ARGS",
"publish-cli": "echo 'Publish cpl-cli'; cd ./src/cpl_cli; cpl publish; cd ../../;",
"publish-core": "echo 'Publish cpl-core'; cd ./src/cpl_core; cpl publish; cd ../../;",
"publish-query": "echo 'Publish cpl_query'; cd ./src/cpl_query; cpl publish; cd ../../;",
"upload-prod-cli": "echo 'PROD Upload cpl-cli'; cpl upl-prod-cli;",
"upl-prod-cli": "twine upload -r pip.sh-edraft.de dist/cpl-cli/publish/setup/*",
"upload-prod-core": "echo 'PROD Upload cpl-core'; cpl upl-prod-core;",
@ -55,18 +63,21 @@
"upl-dev-core": "twine upload -r pip-dev.sh-edraft.de dist/cpl-core/publish/setup/*",
"upload-dev-query": "echo 'DEV Upload cpl_query'; cpl upl-dev-query;",
"upl-dev-query": "twine upload -r pip-dev.sh-edraft.de dist/cpl-query/publish/setup/*",
"pre-deploy-prod": "cpl sv $ARGS; cpl spu --environment=production;",
"deploy-prod": "cpl deploy-prod-cli; cpl deploy-prod-core; cpl deploy-prod-query;",
"dp": "cpl deploy-prod $ARGS",
"deploy-prod-cli": "cpl publish-cli; cpl upload-prod-cli",
"deploy-prod-core": "cpl publish-core; cpl upload-prod-core",
"deploy-prod-query": "cpl publish-query; cpl upload-prod-query",
"pre-deploy-exp": "cpl sv $ARGS; cpl spu --environment=staging;",
"deploy-exp": "cpl deploy-exp-cli; cpl deploy-exp-core; cpl deploy-exp-query;",
"de": "cpl deploy-exp $ARGS",
"deploy-exp-cli": "cpl publish-cli; cpl upload-exp-cli",
"deploy-exp-core": "cpl publish-core; cpl upload-exp-core",
"deploy-exp-query": "cpl publish-query; cpl upload-exp-query",
"pre-deploy-dev": "cpl sv $ARGS; cpl spu --environment=development;",
"deploy-dev": "cpl deploy-dev-cli; cpl deploy-dev-core; cpl deploy-dev-query;",
"dd": "cpl deploy-dev $ARGS",

View File

@ -1,4 +1,3 @@
import time
import unittest
from cpl_core.application import ApplicationABC

View File

@ -5,7 +5,7 @@ import unittest
from unittests_cli.add_test_case import AddTestCase
from unittests_cli.build_test_case import BuildTestCase
from unittests_cli.constants import PLAYGROUND
from unittests_cli.constants import PLAYGROUND_PATH
from unittests_cli.generate_test_case import GenerateTestCase
from unittests_cli.install_test_case import InstallTestCase
from unittests_cli.new_test_case import NewTestCase
@ -45,19 +45,19 @@ class CLITestSuite(unittest.TestSuite):
def _setup(self):
print(f'Setup {__name__}')
try:
if os.path.exists(PLAYGROUND):
shutil.rmtree(PLAYGROUND)
if os.path.exists(PLAYGROUND_PATH):
shutil.rmtree(PLAYGROUND_PATH)
os.mkdir(PLAYGROUND)
os.chdir(PLAYGROUND)
os.mkdir(PLAYGROUND_PATH)
os.chdir(PLAYGROUND_PATH)
except Exception as e:
print(f'Setup of {__name__} failed: {traceback.format_exc()}')
def _cleanup(self):
print(f'Cleanup {__name__}')
try:
if os.path.exists(PLAYGROUND):
shutil.rmtree(PLAYGROUND)
if os.path.exists(PLAYGROUND_PATH):
shutil.rmtree(PLAYGROUND_PATH)
except Exception as e:
print(f'Cleanup of {__name__} failed: {traceback.format_exc()}')

View File

@ -1,3 +1,4 @@
import os
PLAYGROUND = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground'))
PLAYGROUND_PATH = os.path.abspath(os.path.join(os.getcwd(), '../generated/test_cli_playground'))
CLI_PATH = os.path.abspath(os.path.join(os.getcwd(), '../../cpl_cli/main.py'))

View File

@ -1,18 +1,15 @@
import os.path
import unittest
from unittests_cli.constants import PLAYGROUND
from unittests_cli.constants import PLAYGROUND_PATH
from unittests_shared.cli_commands import CLICommands
class GenerateTestCase(unittest.TestCase):
def setUp(self):
pass
def _test_file(self, schematic: str, suffix: str):
CLICommands.generate(schematic, 'GeneratedFile')
file_path = os.path.abspath(os.path.join(PLAYGROUND, f'generated_file{suffix}.py'))
file_path = os.path.abspath(os.path.join(PLAYGROUND_PATH, f'generated_file{suffix}.py'))
file_exists = os.path.exists(file_path)
self.assertTrue(file_exists)
os.remove(file_path)

View File

@ -1,13 +1,15 @@
import os
import subprocess
from unittests_cli.constants import CLI_PATH
class CLICommands:
@staticmethod
def _run(cmd: str, *args):
env_vars = os.environ
command = ['python', os.path.abspath(os.path.join(os.getcwd(), '../../../cpl_cli/main.py')), cmd]
command = ['python', CLI_PATH, cmd]
for arg in args:
command.append(arg)