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

feat(#425): E2E test actions #620

Merged
merged 47 commits into from
Jul 15, 2024
Merged

feat(#425): E2E test actions #620

merged 47 commits into from
Jul 15, 2024

Conversation

m5r
Copy link
Member

@m5r m5r commented Jul 1, 2024

Description

#425

This PR adds a first E2E test covering the compile-app-settings and upload-app-settings actions. Tests are run against an actual CHT instance using CHT Docker helper and are run automatically in the CI.

The containers the CI runs with cannot resolve local-ip.medicmobile.org even though they can resolve 127-0-0-1.local-ip.medic.org 🤔 (related medic-infrastructure issue) so the E2E tests are running a slightly modified docker helper script to force DNS resolution. It's a temporary band-aid that should be removed as soon as the DNS issue is fixed.

Code review items

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or integration tests where appropriate
  • Backwards compatible: Works with existing data and configuration. Any breaking changes documented in the release notes.

License

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

Copy link
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

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

Most excellent! Very nice all around. I have a few minor suggestions and questions, but otherwise this seems ready to go!

package.json Outdated Show resolved Hide resolved
.github/workflows/build.yml Show resolved Hide resolved
test/e2e/cht-docker-utils.js Show resolved Hide resolved
test/e2e/cht-docker-utils.js Outdated Show resolved Hide resolved
test/e2e/cht-docker-utils.js Outdated Show resolved Hide resolved
test/e2e/edit-app-settings.spec.js Outdated Show resolved Hide resolved
test/e2e/cht-docker-utils.js Outdated Show resolved Hide resolved
test/e2e/edit-app-settings.spec.js Outdated Show resolved Hide resolved
test/e2e/edit-app-settings.spec.js Outdated Show resolved Hide resolved
test/e2e/edit-app-settings.spec.js Outdated Show resolved Hide resolved
Copy link

@tatilepizs tatilepizs left a comment

Choose a reason for hiding this comment

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

Thank you for adding this test @m5r, it looks great ⭐

Just one thing, I didn't find a section in cht-docs that was related to cht-conf, only the README file, I don't know if this was already discussed at some point and we decided to manage the cht-conf documentation outside the cht-docs 🤷‍♀️ but I think that it will be important to add a section about these e2e tests (in the README file or maybe create a new section in cht-docs) to talk about how can we run them (npm run test-e2e) and maybe about the possible errors that we can find.
For example I had the same error that Josh mention here, luckily I read that comment before trying to execute the tests 😅 , but then I had a error because my CHT server was never up, and I had to increase the timeout value to 100_000 to be able to run it locally.

We can create something similar (but smaller) to the tests specification for cht-core -> Automated Tests

@m5r m5r requested a review from jkuester July 11, 2024 20:01
@m5r
Copy link
Member Author

m5r commented Jul 11, 2024

@tatilepizs excellent idea! First, I've added logs and increased the timeout to 120 seconds. This should be enough as it rarely takes more than 60 seconds in the CI to spin up an instance. cht-core's API tests have a 200 second timeout but I don't think we need to reach for that high timeout at this stage.
Second, I've added a section in the README to cover the npm run e2e-test command and how tests are run. Let me know if anything is missing/needs clarification.

And finally to answer your question, I don't know either why cht-docs doesn't have much covering cht-conf..

@mrjones-plip
Copy link
Contributor

I don't know either why cht-docs doesn't have much covering cht-conf...

This is both a question and an answer ;) It's not been documented because people keep asking the question!!

If either of you are interested in starting docs on this, possibly with a first step of creating a docs page and replacing the enire readme with a "see docs site!" link, that'd be great!

cc @esthermmoturi & @nsitaula

@tatilepizs
Copy link

😅 I can help with that. I am going to create a PR to move the README file to the docs. thanks @mrjones-plip

And thanks @m5r for the improvements and the section in the README file 🌟

Copy link
Contributor

@jkuester jkuester left a comment

Choose a reason for hiding this comment

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

LGTM!

@m5r m5r merged commit ba54d49 into main Jul 15, 2024
7 checks passed
@m5r m5r deleted the 425-improve-testing-on-cht-conf branch July 15, 2024 12:50
@m5r m5r linked an issue Jul 15, 2024 that may be closed by this pull request
@medic-ci
Copy link
Collaborator

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@garethbowen
Copy link
Member

@m5r NB this should have been a chore not a feat as it's not something that a CLI user will notice.

@m5r
Copy link
Member Author

m5r commented Jul 15, 2024

My bad, thanks @garethbowen for pointing out the correct commit type, I'll keep these guidelines (that's the convention semantic-release follows) in mind for future PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve testing on cht-conf
7 participants