Compare commits

..

No commits in common. "8f10f8b708135a21510a43fa4b622253dfda1f81" and "28b5ef8b4b1ef5baf819d7b1256c2f091d1ddc01" have entirely different histories.

4 changed files with 11 additions and 19 deletions

View file

@ -17,7 +17,7 @@ preflight:
stage: preflight
script:
- pwd
- git clone -b finl_fail_and_success "http://gitlab-ci-token:$ACCESS_TOKEN@git.mfd.msk/mfd/clearing_test.git"
- git clone -b successful_set_with_df01_renamed "http://gitlab-ci-token:$ACCESS_TOKEN@git.mfd.msk/mfd/clearing_test.git"
artifacts:
name: "$CI_COMMIT_REF_NAME"
expire_in: 1 day
@ -59,9 +59,8 @@ test:
- 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 "Cleaning up log volume" && docker volume rm clr_test_logs_volume
- cat clr_test/results.txt && ! grep -q "failed" clr_test/results.txt
artifacts:
expire_in: 7 day
expire_in: 1 day
when: always
paths:
- artifacts/logs

View file

@ -131,8 +131,8 @@ fi
if [ "$TESTER_EXIT_CODE" -eq "0" ]
then
echo "Test case ${CLR_TEST_NAME} passed successfully"
exit 0
else
echo "Test case ${CLR_TEST_NAME} failed"
exit 1
fi
exit 0

View file

@ -35,9 +35,10 @@ services:
condition: service_started
volumes:
- logs_volume:/opt/clearing/bin/log_artifacts
# restart: always
zookeeper:
image: mirror.gcr.io/confluentinc/cp-zookeeper
image: mirror.gcr.io/confluentinc/cp-zookeeper:6.2.3.amd64
container_name: zookeeper
environment:
ZOOKEEPER_SERVER_ID: 1
@ -45,7 +46,7 @@ services:
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: mirror.gcr.io/confluentinc/cp-kafka
image: mirror.gcr.io/confluentinc/cp-kafka:6.2.3.amd64
container_name: kafka
environment:
KAFKA_BROKER_ID: 1

View file

@ -50,6 +50,9 @@ def run_docker(folder_name: str) -> int:
os.chdir("..")
if code != 0:
sys.exit(code)
return code
@ -88,14 +91,6 @@ def copy_directory(path_from: str, path_to: str) -> None:
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:
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")
@ -108,8 +103,7 @@ def apply_test_case(folder: str) -> None:
remove_files_with_extensions(".xml")
# change_date(folder)
exit_code = run_docker(folder)
append_to_log_file(folder, exit_code)
run_docker(folder)
def stop_docker_compose() -> None:
@ -157,8 +151,6 @@ def combine_ddl_updates_into_file():
def main() -> None:
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()
for folder in folders:
stop_docker_compose()