medic / cht-interoperability

CHT - eCHIS interoperability project
GNU Affero General Public License v3.0
2 stars 3 forks source link

73 implement e2e test #83

Closed lorerod closed 1 year ago

lorerod commented 1 year ago

Description

Implement the e2e test for one first scenario: The LTFU flow happy path

medic/interoperability#73

Code review checklist

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

lorerod commented 1 year ago

Hi! @andrablaj @njogz @samuelimoisili! I will appreciate your thought about this. The way I thought about this solution was to be able to test the exact steps I execute when testing the workflow locally. Everything begins in mediator/test/e2e-test.sh. The script inits the containers and runs the ltfu workflow calling mediator/test/ltfu-flow.spec.ts. I started this spec having one test (it) per step but felt that it wasn't appropriate because every test needs to work independently, which will end up being super slow. So I decided to make one test for the entire workflow. Right now, the ci pipeline is failing for the e2e. I will check on this first thing on Monday. I suspect it is the base dir. Running the test locally works for me. Thanks!

samuelimoisili commented 1 year ago

The e2e test is failing on my computer. Here's the error I get each time I try to run it:

(node:7554) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
 FAIL  test/ltfu-flow.spec.ts
  Steps to follow the Loss To Follow-Up (LTFU) workflow
    ✕ Should follow the LTFU workflow

  ● Steps to follow the Loss To Follow-Up (LTFU) workflow › Should follow the LTFU workflow

    Mediator channel installation failed

      43 |     }
      44 |   } catch (error) {
    > 45 |     throw new Error(`Mediator channel installation failed`);
         |           ^
      46 |   }
      47 | };
      48 | let placeId: string;

      at test/ltfu-flow.spec.ts:45:11
      at fulfilled (test/ltfu-flow.spec.ts:5:58)
andrablaj commented 1 year ago

Confirming that I get the same error as @samuelimoisili when running the e2e test locally:

Screenshot 2023-05-10 at 10 49 26
lorerod commented 1 year ago

@andrablaj I added the fixes you found when debugging. @samuelimoisili can you try again, please?

lorerod commented 1 year ago

Good job on this! I am still getting node error that @samuelimoisili mentioned.

Can you please try running npm install inside ./configurator directory and then, running npm install and npm run e2e-test inside ./mediator directory?