Skip to content

Commit

Permalink
#16: fixed Docker credentials when running ci tests (#17)
Browse files Browse the repository at this point in the history
fixes #16
  • Loading branch information
tomuben authored Jun 8, 2022
1 parent cdc5e78 commit aeddad1
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 15 deletions.
1 change: 1 addition & 0 deletions doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changes

* [0.3.0](changes_0.3.0.md)
* [0.2.0](changes_0.2.0.md)
* [0.1.0](changes_0.1.0.md)
23 changes: 23 additions & 0 deletions doc/changes/changes_0.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# script-languages-container-ci 0.3.0, released 2022-06-08

Code name: Fix docker credentials on CI tests

## Summary

This release fixes a bug where the docker credentials were not set when running ci tests.

## Bug Fixes

- #16: fixed Docker credentials when running ci tests

## Features / Enhancements

n/a

## Documentation

n/a

## Refactoring

n/a
3 changes: 2 additions & 1 deletion exasol_script_languages_container_ci/lib/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def ci(ctx: click.Context,
ci_build(ctx, flavor_path=flavor_path, rebuild=rebuild, build_docker_repository=docker_build_repository,
commit_sha=commit_sha,
docker_user=docker_user, docker_password=docker_password)
ci_test(ctx, flavor_path=flavor_path, branch_name=branch_name, git_access=git_access)
ci_test(ctx, flavor_path=flavor_path, branch_name=branch_name, git_access=git_access,
docker_user=docker_user, docker_password=docker_password)
ci_security_scan(ctx, flavor_path=flavor_path)
ci_push(ctx, flavor_path=flavor_path,
target_docker_repository=docker_build_repository, target_docker_tag_prefix=commit_sha,
Expand Down
13 changes: 8 additions & 5 deletions exasol_script_languages_container_ci/lib/ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ def _need_to_run_tests(branch_name: str, git_access: GitAccess):
return BranchConfig.test_always(branch_name) or "[skip tests]" not in git_access.get_last_commit_message()


def execute_tests(ctx: click.Context, flavor_path: Tuple[str, ...]):
def execute_tests(ctx: click.Context, flavor_path: Tuple[str, ...], docker_user: str, docker_password: str):
"""
Run db tests
"""
logging.info(f"Running command 'run_db_test' for flavor-path {flavor_path}")
ctx.invoke(run_db_test, flavor_path=flavor_path, workers=7)
ctx.invoke(run_db_test, flavor_path=flavor_path, workers=7, source_docker_username=docker_user,
source_docker_password=docker_password)
logging.info(f"Running command 'run_db_test' for linker_namespace_sanity for flavor-path {flavor_path}")
ctx.invoke(run_db_test, flavor_path=flavor_path, workers=7,
test_folder=("test/linker_namespace_sanity",), release_goal=("base_test_build_run",))
test_folder=("test/linker_namespace_sanity",), release_goal=("base_test_build_run",),
source_docker_username=docker_user, source_docker_password=docker_password)
print_docker_images(logging.info)


def ci_test(ctx: click.Context, flavor_path: Tuple[str, ...], branch_name: str, git_access: GitAccess):
def ci_test(ctx: click.Context, flavor_path: Tuple[str, ...], branch_name: str, git_access: GitAccess,
docker_user: str, docker_password: str):
if _need_to_run_tests(branch_name, git_access):
execute_tests(ctx, flavor_path)
execute_tests(ctx, flavor_path, docker_user, docker_password)
else:
logging.warning("Skipping tests.")
2 changes: 1 addition & 1 deletion exasol_script_languages_container_ci/lib/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def release(ctx: click.Context,

ci_build(ctx, flavor_path=flavor_path, rebuild=True, build_docker_repository="",
commit_sha="", docker_user="", docker_password="")
execute_tests(ctx, flavor_path=flavor_path)
execute_tests(ctx, flavor_path=flavor_path, docker_user=docker_user, docker_password=docker_password)
if not is_dry_run:
ci_push(ctx, flavor_path=flavor_path,
target_docker_repository=docker_release_repository, target_docker_tag_prefix="",
Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "exasol-script-languages-container-ci"
version = "0.2.0"
version = "0.3.0"
description = "Implements CI builds for script-language-container."

license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

setup_kwargs = {
'name': 'exasol-script-languages-container-ci',
'version': '0.2.0',
'version': '0.3.0',
'description': 'Implements CI builds for script-language-container.',
'long_description': None,
'author': 'Thomas Uebensee',
Expand Down
6 changes: 4 additions & 2 deletions test/exaslct_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ def build_test_container_call(force_rebuild: bool):


def run_db_test_call():
return call(run_db_test, flavor_path=("flavors/TEST_FLAVOR",), workers=7)
return call(run_db_test, flavor_path=("flavors/TEST_FLAVOR",), workers=7,
source_docker_username=test_env.docker_user, source_docker_password=test_env.docker_pwd)


def run_db_test_call_for_linker_namespace():
return call(run_db_test, flavor_path=("flavors/TEST_FLAVOR",), workers=7,
test_folder=("test/linker_namespace_sanity",), release_goal=("base_test_build_run",))
test_folder=("test/linker_namespace_sanity",), release_goal=("base_test_build_run",),
source_docker_username=test_env.docker_user, source_docker_password=test_env.docker_pwd)


def security_scan_call():
Expand Down

0 comments on commit aeddad1

Please sign in to comment.