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

1634 E2E tests #2053

Merged
merged 20 commits into from
May 28, 2024
Merged

1634 E2E tests #2053

merged 20 commits into from
May 28, 2024

Conversation

leite08
Copy link
Member

@leite08 leite08 commented May 9, 2024

Ticket: https://github.com/metriport/metriport-internal/issues/1634

Dependencies

Description

V1 of E2E tests in production:

  • gets an organization
  • updates an organization
  • creates a facility
  • gets a facility
  • updates a facility
  • creates and gets the patient
  • awaits patient update to be replicated
  • creates consolidated data
  • counts consolidated data
  • returns consolidated data
  • triggers a conversion of consolidated into HTML format
  • completes conversion successfully
  • triggers a document query
  • gets successful response from document query
  • contains expected data on FHIR server
  • deletes a patient's consolidated data
  • deletes the patient
  • deletes the facility

Those tests are the first iteration of the E2E tests in production. For the complete list please refer to the ticket.

Testing

  • Local
    • E2E tests run
  • Staging
    • E2E tests run
  • Sandbox
    • E2E tests run
  • Production
    • E2E tests run

Release Plan

  • Added to monthly product update
  • Publish Node SDK
    • From Local/Lerna
  • Publish Python SDK w/ Fern
    • GH Action: Release Python SDK
  • Merge upstream
  • Merge this
  • Merge downstream

Base automatically changed from 1634-add-manual-e2e-test-to-cicd to develop May 9, 2024 14:14
@leite08 leite08 changed the base branch from develop to 1634-move-e2e-tests May 9, 2024 14:23
@leite08 leite08 force-pushed the 1634-improve-e2e-tests branch 2 times, most recently from 565c9e0 to e5cd64a Compare May 14, 2024 00:45
@leite08 leite08 changed the title 1634 WIP improve e2e tests 1634 E2E tests May 18, 2024
Copy link
Member Author

Choose a reason for hiding this comment

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

This was used to test the intermittent execution of E2E tests, which is not an issue anymore (after we removed the release step).

@@ -88,7 +86,6 @@ jobs:
working-directory: "./"
env:
TEST_API_KEY: ${{ secrets.TEST_API_KEY }}
TEST_ACC_ID: ${{ secrets.TEST_ACC_ID }}
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed as its not used anywhere

Comment on lines +9 to +11
firstName: "Junhdjjdkksuyujebeb",
lastName: "Xamuscaeyttyworo",
dob: "1900-01-01",
Copy link
Member Author

@leite08 leite08 May 18, 2024

Choose a reason for hiding this comment

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

Fixing to something that won't have a match

@@ -12,7 +12,7 @@ export const testApiKey = getEnvVarOrFail("TEST_API_KEY");
export const baseURL = getEnvVarOrFail("API_URL");

export const api = Axios.create({
timeout: 10_000,
timeout: 20_000,
Copy link
Member Author

Choose a reason for hiding this comment

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

Try to avoid the timeout from FHIR server to search by org name

Comment on lines +5 to 6
dotenv.config({ path: path.resolve(...paths, ".env") });
dotenv.config({ path: path.resolve(...paths, ".env.test") });
Copy link
Member Author

Choose a reason for hiding this comment

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

This prioritizes the .env local if available

@@ -22,6 +22,6 @@ export function makeDocumentQueryProgress(
return {
download: makeProgress(seed.download),
convert: makeProgress(seed.convert),
requestId: seed.requestId === null ? undefined : seed.requestId ?? faker.datatype.uuid(),
requestId: seed.requestId === null ? undefined : seed.requestId ?? faker.string.uuid(),
Copy link
Member Author

Choose a reason for hiding this comment

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

Replace the deprecated version

patient: Patient,
facilityId: string
): Promise<CommonwellPatient | undefined> {
const { debug } = Util.out(`CW get - M patientId ${patient.id}`);
Copy link
Member

Choose a reason for hiding this comment

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

Seems to be using the deprecated Util.Out

Copy link
Member Author

Choose a reason for hiding this comment

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

I was following the other functions on the same file, but updated them all to use the active one. 👍

facilityId,
debug,
});
if (!cwEnabled) return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

I know this function isnt being used yet but it would help to add a log here so we can better diagnose if we didnt get anyting when its in prod

Copy link
Member Author

Choose a reason for hiding this comment

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

The other endpoints don't log directly, they all do through validateCWEnabled().

leite08 added 19 commits May 27, 2024 15:01
- WIP simplified e2e test
- add "Run E2E test" GH workflow to be run manually

Ref. metriport/metriport-internal#1634
@leite08 leite08 mentioned this pull request May 28, 2024
8 tasks
@leite08 leite08 added this pull request to the merge queue May 28, 2024
Merged via the queue into develop with commit 7c2e953 May 28, 2024
36 checks passed
@leite08 leite08 deleted the 1634-improve-e2e-tests branch May 28, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants