test cases validator added, kafka and zookeeper versions removed in docker-compose.yml
This commit is contained in:
parent
ecab562499
commit
9e09ca7486
4 changed files with 18 additions and 10 deletions
|
|
@ -59,8 +59,9 @@ test:
|
||||||
- python3 clr_test/run_test_docker_containers.py
|
- python3 clr_test/run_test_docker_containers.py
|
||||||
- echo "Copying logs" && mkdir -p artifacts/logs && docker run --rm -v clr_test_logs_volume:/logs alpine tar -C /logs -cf - . | tar -C artifacts/logs -xf -
|
- echo "Copying logs" && mkdir -p artifacts/logs && docker run --rm -v clr_test_logs_volume:/logs alpine tar -C /logs -cf - . | tar -C artifacts/logs -xf -
|
||||||
- echo "Cleaning up log volume" && docker volume rm clr_test_logs_volume
|
- echo "Cleaning up log volume" && docker volume rm clr_test_logs_volume
|
||||||
|
- cat clr_test/results.txt && ! grep -q "failed" clr_test/results.txt
|
||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 day
|
expire_in: 7 day
|
||||||
when: always
|
when: always
|
||||||
paths:
|
paths:
|
||||||
- artifacts/logs
|
- artifacts/logs
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,8 @@ fi
|
||||||
if [ "$TESTER_EXIT_CODE" -eq "0" ]
|
if [ "$TESTER_EXIT_CODE" -eq "0" ]
|
||||||
then
|
then
|
||||||
echo "Test case ${CLR_TEST_NAME} passed successfully"
|
echo "Test case ${CLR_TEST_NAME} passed successfully"
|
||||||
|
exit 0
|
||||||
else
|
else
|
||||||
echo "Test case ${CLR_TEST_NAME} failed"
|
echo "Test case ${CLR_TEST_NAME} failed"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
@ -35,10 +35,9 @@ services:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
volumes:
|
volumes:
|
||||||
- logs_volume:/opt/clearing/bin/log_artifacts
|
- logs_volume:/opt/clearing/bin/log_artifacts
|
||||||
# restart: always
|
|
||||||
|
|
||||||
zookeeper:
|
zookeeper:
|
||||||
image: mirror.gcr.io/confluentinc/cp-zookeeper:6.2.3.amd64
|
image: mirror.gcr.io/confluentinc/cp-zookeeper
|
||||||
container_name: zookeeper
|
container_name: zookeeper
|
||||||
environment:
|
environment:
|
||||||
ZOOKEEPER_SERVER_ID: 1
|
ZOOKEEPER_SERVER_ID: 1
|
||||||
|
|
@ -46,7 +45,7 @@ services:
|
||||||
ZOOKEEPER_TICK_TIME: 2000
|
ZOOKEEPER_TICK_TIME: 2000
|
||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
image: mirror.gcr.io/confluentinc/cp-kafka:6.2.3.amd64
|
image: mirror.gcr.io/confluentinc/cp-kafka
|
||||||
container_name: kafka
|
container_name: kafka
|
||||||
environment:
|
environment:
|
||||||
KAFKA_BROKER_ID: 1
|
KAFKA_BROKER_ID: 1
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,6 @@ def run_docker(folder_name: str) -> int:
|
||||||
|
|
||||||
os.chdir("..")
|
os.chdir("..")
|
||||||
|
|
||||||
if code != 0:
|
|
||||||
sys.exit(code)
|
|
||||||
|
|
||||||
return code
|
return code
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -91,6 +88,14 @@ def copy_directory(path_from: str, path_to: str) -> None:
|
||||||
shutil.copytree(path_from, path_to, dirs_exist_ok=True)
|
shutil.copytree(path_from, path_to, dirs_exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
|
def append_to_log_file(test_case: str, code: int) -> None:
|
||||||
|
with open("clr_test/results.txt", 'a') as f:
|
||||||
|
if code == 0:
|
||||||
|
f.write(f"Test case {test_case} passed successfully\n")
|
||||||
|
else:
|
||||||
|
f.write(f"Test case {test_case} failed\n")
|
||||||
|
|
||||||
|
|
||||||
def apply_test_case(folder: str) -> None:
|
def apply_test_case(folder: str) -> None:
|
||||||
remove_directory(f"{CLR_TEST_DIR}/clearing-all/clearing_testing_utils/store/expected")
|
remove_directory(f"{CLR_TEST_DIR}/clearing-all/clearing_testing_utils/store/expected")
|
||||||
remove_directory(f"{CLR_TEST_DIR}/clearing-all/clearing_testing_utils/store/input")
|
remove_directory(f"{CLR_TEST_DIR}/clearing-all/clearing_testing_utils/store/input")
|
||||||
|
|
@ -103,7 +108,8 @@ def apply_test_case(folder: str) -> None:
|
||||||
|
|
||||||
remove_files_with_extensions(".xml")
|
remove_files_with_extensions(".xml")
|
||||||
# change_date(folder)
|
# change_date(folder)
|
||||||
run_docker(folder)
|
exit_code = run_docker(folder)
|
||||||
|
append_to_log_file(folder, exit_code)
|
||||||
|
|
||||||
|
|
||||||
def stop_docker_compose() -> None:
|
def stop_docker_compose() -> None:
|
||||||
|
|
@ -151,6 +157,8 @@ def combine_ddl_updates_into_file():
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
folders = [i for i in sorted(os.listdir(DATA_ROOT_DIR)) if re.search("\\d{1,}.\\d{1,}.*", i)]
|
folders = [i for i in sorted(os.listdir(DATA_ROOT_DIR)) if re.search("\\d{1,}.\\d{1,}.*", i)]
|
||||||
|
|
||||||
|
remove_if_exists("clr_test/results.txt")
|
||||||
|
|
||||||
combine_ddl_updates_into_file()
|
combine_ddl_updates_into_file()
|
||||||
for folder in folders:
|
for folder in folders:
|
||||||
stop_docker_compose()
|
stop_docker_compose()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue