Skip to content

Commit

Permalink
running with my-integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Oct 9, 2024
1 parent 31eee9d commit a7fac99
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test +projects=PROJECTS:
for p in "{{projects}}".split():
run(f"poetry -C {p}/ install")
run(f"poetry -C {p}/ run nox -f {p}/noxfile.py -s integration-tests")
run(f"poetry -C {p}/ run nox -f {p}/noxfile.py -s my-integration-tests")
# run(f"poetry -C {p}/ run pytest -s {p}/test")
sys.exit(rc)

Expand Down
11 changes: 11 additions & 0 deletions pytest-extension/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
import sys

import nox
from nox import Session
from noxconfig import PROJECT_CONFIG

print(sys.path)
# imports all nox task provided by the toolbox
from exasol.toolbox.nox.tasks import * # pylint: disable=wildcard-import disable=unused-wildcard-import

# default actions to be run if nothing is explicitly specified with the -s option
nox.options.sessions = ["fix"]


@nox.session(name="my-integration-tests", python=False)
def my_integration_tests(session: Session) -> None:
path = PROJECT_CONFIG.root / "test" / "integration"
base_command = ["poetry", "run"]
pytest_command = ["pytest", "-v", "-s", f"{path}"]
command = base_command + pytest_command
session.run(*command)
21 changes: 9 additions & 12 deletions pytest-extension/test/integration/pytest_extension_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,14 @@ def validate_database_std_params(**kwargs):
assert res
def validate_bucketfs_std_params(**kwargs):
try:
# Temporary work around for the bug in PEC (Issue#78 - no default for the path_in_bucket
if StdParams.path_in_bucket.name in kwargs and kwargs[StdParams.path_in_bucket.name] is None:
kwargs[StdParams.path_in_bucket.name] = ''
bfs_path = create_bucketfs_location(**kwargs)
bfs_path = bfs_path / 'test_file.txt'
bfs_path.write(TEST_FILE_CONTENT)
file_content = b"".join(bfs_path.read())
assert file_content == TEST_FILE_CONTENT
except Exception as ex:
pass
# Temporary work around for the bug in PEC (Issue#78 - no default for the path_in_bucket
if StdParams.path_in_bucket.name in kwargs and kwargs[StdParams.path_in_bucket.name] is None:
kwargs[StdParams.path_in_bucket.name] = ''
bfs_path = create_bucketfs_location(**kwargs)
bfs_path = bfs_path / 'test_file.txt'
bfs_path.write(TEST_FILE_CONTENT)
file_content = b"".join(bfs_path.read())
assert file_content == TEST_FILE_CONTENT
def validate_cli_args(backend, cli_args, base_tag, callback):
if backend == BACKEND_ONPREM:
Expand All @@ -94,7 +91,7 @@ def validate_cli_args(backend, cli_args, base_tag, callback):
opts = select_std_options(tags)
cmd = click.Command('whatever', params=opts, callback=callback)
runner = CliRunner()
runner.invoke(cmd, args=cli_args, catch_exceptions=False, standalone_mode=True)
runner.invoke(cmd, args=cli_args, catch_exceptions=False, standalone_mode=False)
def test_database_std_params(database_std_params):
validate_database_std_params(**database_std_params)
Expand Down

0 comments on commit a7fac99

Please sign in to comment.