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

Integration tests #3206

Merged
merged 2 commits into from
Mar 20, 2024
Merged

Integration tests #3206

merged 2 commits into from
Mar 20, 2024

Conversation

gustavosbarreto
Copy link
Member

@gustavosbarreto gustavosbarreto commented Oct 27, 2023

This PR implements the initial phase of our integration testing efforts using Testcontainers.

The approval of this PR depends on the completion of the following tasks:

@gustavosbarreto gustavosbarreto force-pushed the topic/integration-tests branch 4 times, most recently from 06a6b0a to cee00b4 Compare November 14, 2023 20:58
@gustavosbarreto gustavosbarreto marked this pull request as ready for review November 14, 2023 20:58
@gustavosbarreto gustavosbarreto requested a review from a team as a code owner November 14, 2023 20:58
@gustavosbarreto gustavosbarreto force-pushed the topic/integration-tests branch 6 times, most recently from d223418 to 0f41be3 Compare November 14, 2023 23:54
@gustavosbarreto gustavosbarreto force-pushed the topic/integration-tests branch 2 times, most recently from 97e8b21 to 7971af3 Compare March 18, 2024 12:43
@heiytor heiytor force-pushed the topic/integration-tests branch 3 times, most recently from afafba0 to 627d93f Compare March 20, 2024 17:21
@heiytor heiytor force-pushed the topic/integration-tests branch 3 times, most recently from 63f16b9 to 2ea57f3 Compare March 20, 2024 18:15
The environment framework provides an easy way to create, manage and
destroy ShellHub instances. with Docker Compose. Internally, it uses
`testcontainers-go` to manage services.

To get started, call `New`, which creates a new
`DockerComposeConfigurator`. A configurator is a helper struct to manage
"docker-composes". By default, a new configurator reads from `.env` to
set up all environment variables. To avoid boilerplate between test
cases a clone of a configurator can be made; a clone has the same data
as the original configurator but is an isolated pointer. Every
configurator is associated with a `testing.T`, which is used to make
standard assertations.

To start the instance, you can call `DockerComposeConfigurator.Up`,
which returns a `DockerCompose`. A Docker Compose is a code
representation of the running instance; it also has a
`DockerCompose.Down` method, which stops and cleans up all allocated
resources for the instance. Generally, it is passed to
`testing.T.Cleanup`.

The running instance provides helper methods to facilitate
docker-compose manipulation and comunication. It also provides helper
methods for generic pipelines (e.g., creating a user).
@gustavosbarreto gustavosbarreto merged commit acb9f14 into master Mar 20, 2024
10 checks passed
@gustavosbarreto gustavosbarreto deleted the topic/integration-tests branch March 20, 2024 19:48
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.

None yet

2 participants