From 02fe0d09742f0eb2569d084857bfc1094a6462b5 Mon Sep 17 00:00:00 2001 From: "Federico M. Facca" Date: Fri, 25 Feb 2022 23:52:22 +0100 Subject: [PATCH 1/2] pandora box surfacing --- .circleci/config.yml | 2 +- RELEASE_NOTES.md | 1 + src/tests/common.py | 22 +++++++++++++--------- src/tests/run_tests.sh | 2 +- src/tests/test_bc.py | 7 +++++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e5945a1b..f6c30556 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: - "/usr/local/bin" - "/usr/local/lib/python3.8" - "/opt/circleci/.pyenv/versions/3.8.5/lib" - - run: docker build -t orchestracities/quantumleap . + - run: docker build -t orchestracities/quantumleap:latest . - run: source deps.env && cd docker && docker-compose pull test_translator: parameters: diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b5e9b7d5..f108d763 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -16,6 +16,7 @@ ### Bug fixes - Fix issues with integration tests and backward compatibility tests +- Fix forward compatibility issue from <=0.8.2 to 0.8.3 (#638) ### Continuous Integration diff --git a/src/tests/common.py b/src/tests/common.py index fb3264c4..c3a3f8dd 100644 --- a/src/tests/common.py +++ b/src/tests/common.py @@ -98,10 +98,10 @@ def create_entities(old=True, entity_type="IntegrationTestEntity"): "/", entity_type), ] - if old: - entities.append(IntegrationTestEntity("ite6", None, None, entity_type)) - else: - entities.append(IntegrationTestEntity("ite6", None, "/", entity_type)) + #if old: + # entities.append(IntegrationTestEntity("ite6", None, None, entity_type)) + #else: + # entities.append(IntegrationTestEntity("ite6", None, "/", entity_type)) return entities @@ -147,7 +147,13 @@ def load_data(old=True, entity_type="IntegrationTestEntity"): assert res.ok, res.text # Update Entities in Orion - for i in range(UPDATES): + update_data(entities) + + return entities + + +def update_data(entities, updates=UPDATES): + for i in range(updates): # this sleep ensures that there is some time between entities # updates, to avoid that orion combines notifications time.sleep(1) @@ -158,10 +164,8 @@ def load_data(old=True, entity_type="IntegrationTestEntity"): res = requests.patch(url, data=json.dumps(patch), headers=h) assert res.ok, res.text - return entities - -def check_data(entities, check_n_indexes=False): +def check_data(entities, check_n_indexes=False, updates=UPDATES): check_orion_url() check_ql_url() @@ -196,7 +200,7 @@ def check_data(entities, check_n_indexes=False): # to subscription creation, but this may not be supported by old orion # if check_n_indexes: - assert len(index) == UPDATES + 1 + assert len(index) == updates + 1 # Now without explicit type to trigger type search in metadata table res = requests.get(url, headers=e.headers()) diff --git a/src/tests/run_tests.sh b/src/tests/run_tests.sh index f4fc8569..1049c9a5 100644 --- a/src/tests/run_tests.sh +++ b/src/tests/run_tests.sh @@ -2,7 +2,7 @@ # Prepare Docker Images docker pull orchestracities/quantumleap:${PREV_QL} -docker build -t orchestracities/quantumleap ../../ +docker build -t orchestracities/quantumleap:latest ../../ CRATE_VERSION=${PREV_CRATE} docker-compose -f docker-compose-bc.yml pull --ignore-pull-failures tot=0 diff --git a/src/tests/test_bc.py b/src/tests/test_bc.py index 676a88b2..8cf5c10f 100644 --- a/src/tests/test_bc.py +++ b/src/tests/test_bc.py @@ -1,14 +1,17 @@ from tests.common import check_data, unload_data, create_entities, \ - check_deleted_data + check_deleted_data, update_data, UPDATES def test_backwards_compatibility(): # NOTE: load_data() must be called using previous QL version! # see run_tests.sh - entities = create_entities() + entities = create_entities(old=False) assert len(entities) > 1 try: check_data(entities) + #add more data + update_data(entities, updates=1) + check_data(entities, check_n_indexes=True, updates=UPDATES + 1) finally: unload_data(entities) check_deleted_data(entities) From 8bf5edde9497ce3ec35841b5549171085af12ef6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 00:02:51 +0100 Subject: [PATCH 2/2] autopep8 action fixes (#640) Co-authored-by: chicco785 --- src/tests/common.py | 4 ++-- src/tests/test_bc.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/common.py b/src/tests/common.py index c3a3f8dd..4710db6f 100644 --- a/src/tests/common.py +++ b/src/tests/common.py @@ -98,9 +98,9 @@ def create_entities(old=True, entity_type="IntegrationTestEntity"): "/", entity_type), ] - #if old: + # if old: # entities.append(IntegrationTestEntity("ite6", None, None, entity_type)) - #else: + # else: # entities.append(IntegrationTestEntity("ite6", None, "/", entity_type)) return entities diff --git a/src/tests/test_bc.py b/src/tests/test_bc.py index 8cf5c10f..50b775f0 100644 --- a/src/tests/test_bc.py +++ b/src/tests/test_bc.py @@ -9,7 +9,7 @@ def test_backwards_compatibility(): assert len(entities) > 1 try: check_data(entities) - #add more data + # add more data update_data(entities, updates=1) check_data(entities, check_n_indexes=True, updates=UPDATES + 1) finally: