Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandora box surfacing #639

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 13 additions & 9 deletions src/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand All @@ -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()

Expand Down Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/tests/test_bc.py
Original file line number Diff line number Diff line change
@@ -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)