department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

Run API unit tests in a container in a GH runner, not directly in the GH runner #2044

Open cris-oddball opened 1 month ago

cris-oddball commented 1 month ago

User Story - Business Need

On 9 OCT 2024, GitHub updated their runners such that ubuntu:latest was upgraded to 24.04.1. This failed to run the unit tests with this error

oscrypto.errors.LibraryNotFoundError: Error detecting the version of libcrypto

To work around this issue, the GH action that runs the tests was modified to pin ubuntu down to ubuntu-22.04 in this Hotfix.

After a brief discussion, the team decided that it would be best to run the unit tests in a container, preferably using Alpine (to match the API docker images). See the QA repo for an example, since those tests run in a container.

User Story(ies)

As a VANotify engineer I want to run unit tests in a container when I push my branch So that we can completely control the OS the tests run on and not be at the mercy of a random GH upgrade.

Additional Info and Resources

Failed run

Screenshot 2024-10-09 at 12.35.18 PM.jpg

Apparently, the error can also happen when the memory is too low. We could try using a GH Ubuntu runner with more cores (and thus more memory) but the preferred outcome is to be able to fully control the OS the tests run in, which means using a container.

Acceptance Criteria

QA Considerations

Potential Dependencies

npmartin-oddball commented 1 month ago

Hey team! Please add your planning poker estimate with Zenhub @cris-oddball @EvanParish @k-macmillan @kalbfled @MackHalliday @mchlwellman