Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

fix(testy): improve testing flow #680

Merged
merged 3 commits into from
Oct 15, 2021
Merged

fix(testy): improve testing flow #680

merged 3 commits into from
Oct 15, 2021

Conversation

simonvadee
Copy link
Contributor

@simonvadee simonvadee commented Oct 15, 2021

Description

Fix many small issues on e2e tests:

  • timeout was not taken into account (and batch is deleted if timeout is exceeded)
  • if the source already exist before importing, tests fail. I removed the source before importing it.
  • there was not resource yielding failures in the mimic mapping. I added a erroneous mapping (patient_bad_gender) to test the failed_counters mechanism.
  • env variables to update mimic credentials were not taken into account (see https://github.com/arkhn/deployment/pull/454)

Definition of Done

  • I followed the Arkhn Code Book (I swear!).
  • I have written tests for the code I added or updated.
  • I have updated the documentation according to my changes.
  • I have updated the deployment configuration if needed.

Tests

Launched e2e tests mulltiple times on testy

@simonvadee simonvadee requested a review from tevariou October 15, 2021 09:43

from . import settings

DATA_FIXTURES_DIR = Path(__file__).resolve().parent.parent / "fixtures"


def destroy_source(source):
Copy link
Member

@tevariou tevariou Oct 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could just pass a name here and rename this to something like destroy_source_by_name since that's what this function is specificaly doing ? Or I don't know if it would just work to set autouse=True (with mimic_mapping as an argument) no need to call it in uploaded_mapping then

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, I used a fixture instead!



@pytest.fixture(scope="session")
def batch(uploaded_mapping):
# Send Patient and Encounter batch
batch = send_batch(uploaded_mapping)

while True:
start_time = time()
while time() < start_time + settings.BATCH_DURATION_TIMEOUT:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@simonvadee simonvadee requested a review from tevariou October 15, 2021 12:48
Copy link
Member

@tevariou tevariou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@simonvadee simonvadee merged commit c4ba44c into v4 Oct 15, 2021
@simonvadee simonvadee deleted the sv/improve-testy branch October 15, 2021 14:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants