Skip to content

Request to add pgTAP variant #65

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

Closed
pinealan opened this issue Feb 6, 2023 · 7 comments
Closed

Request to add pgTAP variant #65

pinealan opened this issue Feb 6, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@pinealan
Copy link

pinealan commented Feb 6, 2023

pgTAP is a unit testing toolkit for postgres and CI is a natural place where one would need the test databse to have it available.

Demand for this can be evident from a number of derivative Dockerfiles in the wild that adds pgTap on top of the CircleCI image. These are all unfortunately no longer maintained and based on the legacy images.

It would be great if CCI can support this as an official image.

@pinealan
Copy link
Author

pinealan commented Feb 7, 2023

I've made a branch adding pgTAP to postgres 13.9. Already tried it on CircleCI and it worked fine.

The extension adds about 40MB to the image size. If a PR is welcomed and I can do the same for the other postgres versions.

@BytesGuy
Copy link
Contributor

@pinealan PRs are always welcome! If this is a small change to the image, and does not cause any changes to the behaviour of the image unless specifically invoked, then it might be best to include this in the main image rather than a variant. Postgis variant for example is close to 200MB larger, which is part of the reason it is a separate variant. Please reference this issue when opening the PR and one of the team will review it in due course. Thank you :)

@BytesGuy BytesGuy self-assigned this Mar 29, 2023
@BytesGuy BytesGuy added the enhancement New feature or request label Mar 29, 2023
@villelahdenvuo
Copy link
Contributor

This would be a very welcome addition, we are currently using our custom image due to the need for pgTAP.

@JalexChen
Copy link

JalexChen commented May 31, 2023

Hi @villelahdenvuo and @pinealan - since you two are requesting this change and also using this image the most, i wanted get your thoughts on how we should be supporting extensions. While extensions like pg_cron and pgTap are relatively small, I think they can potentially clutter the Dockerfile.template and also make it harder to debug when there are issues. Since these extensions don't seem to be updated frequently, I think there is little overhead and additional maintenance on our end.

With your workflows, do you think it is better to have a separate variant image, like postgres-postgis so the extensions are isolated?

I've already reviewed #81 and went with that because it implements cpanm and downloads the extension from the source repo. Let me know if there are any objections.

@pinealan
Copy link
Author

pinealan commented Jun 2, 2023

@JalexChen thanks for checking in. My workflow is agnostic to whether I have to use a variant image or not, and in fact that was how my branch was originally implemented. That said I can imagine use cases where someone is using the postgis variant and would like to have access to pgTap too. With these cases they'd either lose out on pgTap because it's not in the base image, or they'd have to fork thier own image. The third option is to have postgres-postgis-pgtap variants, but I think that would be even messier from the maintainer's perspective.

@villelahdenvuo
Copy link
Contributor

I agree that the downside of variants is less cacheability and the difficulty of combining variants. Therefore for smaller extensions I suggest including them in the main image.

@JalexChen
Copy link

pgTap has been merged into the main postgres image. Thank you both again for the contributions and the input.

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

No branches or pull requests

4 participants