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

B 20145 automate tests #18

Merged
merged 21 commits into from
Jul 29, 2024
Merged

B 20145 automate tests #18

merged 21 commits into from
Jul 29, 2024

Conversation

cameroncaci
Copy link
Collaborator

@cameroncaci cameroncaci commented Jul 25, 2024

Ticket B-20145

Tip

This is valuable information for issues that will be encountered when we decide to automate 508 compliance and attempt local testing on the mymove repo

Note

The following discussion highlights limitations within the local environment. These issues DO NOT replicate in the live CircleCI environment. Please see more information in the relevant articles section.

Summary

This reintroduces maven testing for the trdm pipeline by containerizing the CircleCI process, the milmove dependencies, and the postgres container for the test db.

A three container docker-in-docker approach was utilized due to known CircleCI CLI issues and limitations for local development preventing parallel images. These containers will use a remote docker setup with the CircleCI deprecated version 20. This parallel image error can easily be replicated by trying to run one of the mymove CircleCI jobs locally that use an executor with two images.

The entire testing workflow was also put into a single job step due as workflows are another limitation that cannot run locally. By putting it all into a single job step, we include all dependencies meaning we can properly test in our local environments. The testing containers rely on the main mymove branch and execute migrations accordingly.

Workspaces and Docker volumes were not utilized due to additional restrictions encountered with host machine access, a workaround of input streaming was put in place to achieve the same functionality.

How to test locally

  • Make sure CircleCI CLI is installed
  • Make sure Docker is running (Version doesn’t matter due to remote docker versioning)
  • Within the repository, run circleci local execute test

Relevant Articles

Explaining the exact issue encountered
https://discuss.circleci.com/t/circleci-cli-error-response-from-daemon-invalid-uts-mode/48081

Open discussion detailing the parallel image
CircleCI-Public/circleci-cli#970

Discussion detailing the last working docker version
andyatkinson/rideshare#99

Marking 20.10.24 as the deprecated version
https://circleci.com/docs/building-docker-images/#docker-version

Known CircleCI CLI local limitations
https://circleci.com/docs/how-to-use-the-circleci-local-cli/#limitations-of-running-jobs-locally

@cameroncaci
Copy link
Collaborator Author

See passing checks below now 😎👉🏻👉🏻

Copy link
Contributor

@TevinAdams TevinAdams left a comment

Choose a reason for hiding this comment

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

Beautiful to see the tests in the pipeline passing.

@TevinAdams TevinAdams self-requested a review July 29, 2024 13:55
@TevinAdams
Copy link
Contributor

I noticed on my working branch the tests job isn't running. Do we need to do anything or any changes need to be made to make that job run? Let me create a new branch and see if it picks it up.

@TevinAdams
Copy link
Contributor

Yeah it seems like github is expecting that job to run but because your branch isn't pushed up yet onto the other branches the tests job will not run. I believe once this gets merged to main then the configs get pulled down to the branches that job will finally run and sync with github.

@cameroncaci
Copy link
Collaborator Author

Yeah it seems like github is expecting that job to run but because your branch isn't pushed up yet onto the other branches the tests job will not run. I believe once this gets merged to main then the configs get pulled down to the branches that job will finally run and sync with github.

Ah, I see. Yeah I had updated the GitHub settings to require passing checks. Apologies on the brief hiccup

@cameroncaci cameroncaci merged commit 7b316cd into main Jul 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants