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

Use GOV.UK Docker to test GOV.UK Docker #608

Merged
merged 3 commits into from
Jun 28, 2022
Merged

Use GOV.UK Docker to test GOV.UK Docker #608

merged 3 commits into from
Jun 28, 2022

Conversation

benthorner
Copy link
Contributor

Fixes #589.

This adds a new stack so that GOV.UK Docker has its own Ruby
environment to run Ruby commands in.

As part of doing this, I've also tweaked the guidance so that
all the relevant setup instructions are inline with the one use
case that remains for a local Ruby environment - bin/doctor -
which should itself be removed in time 1.

Please see the commits for more details.

Footnotes

  1. https://github.com/alphagov/govuk-docker/issues/435

This matches the current behaviour of CI [^1].

Making this change will help simplify the way we run tests locally.
I've split out the non-Ruby test commands into a new "test-scripts"
recipe as part of this - so that we can reuse it elsewhere.

Normally we would do linting as part of the default "make" task,
but that's not appropriate here as we also run make commands to set
up individual projects; having the default "make" run tests would be
confusing for someone who's just trying to use GOV.UK Docker.

I think it's reasonable to include linting as part of the "test" recipe,
as we generally want to run both if we're changing Ruby code.

[^1]: https://github.com/alphagov/govuk-docker/blob/main/.github/workflows/ci.yml
Ben Thorner added 2 commits June 20, 2022 13:28
This is a bit meta but much easier than forcing someone to create
their own Ruby environment for this purpose.

This leaves bin/doctor as the only part of the repo that requires
a local Ruby environment, so I've moved the installation guidance
to the relevant part of the troubleshoot manual.

Since some of the testing commands assume local file paths or run
Docker itself, we can't run all the "tests" inside a container, so
I've added separate recipes / commands to run the tests on CI and
locally. I'm not worried about them diverging.
Neither of these were necessary for normal use of GOV.UK Docker,
and the previous commits also make them redundant for running the
tests.
Copy link
Member

@kevindew kevindew left a comment

Choose a reason for hiding this comment

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

This is a nice idea. Thanks for your work putting it together. Changes look good to me.

@benthorner benthorner merged commit 32244e2 into main Jun 28, 2022
@benthorner benthorner deleted the meta-docker branch June 28, 2022 08:24
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.

Initial installation assumes rbenv but not setup
2 participants