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

Add API for creating a Testcontainer with auto-termination #27

Closed
3 tasks
oleg-nenashev opened this issue Aug 9, 2023 · 4 comments
Closed
3 tasks

Add API for creating a Testcontainer with auto-termination #27

oleg-nenashev opened this issue Aug 9, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@oleg-nenashev
Copy link
Member

oleg-nenashev commented Aug 9, 2023

Proposal

It would be nice to encapsulate the following code to simplify the tests.

	// Create Container
	ctx := context.Background()
	container, err := RunContainer(ctx,
		WithMappingFile("hello", "hello-world.json"),
	)
	if err != nil {
		t.Fatal(err)
	}

	// Clean up the container after the test is complete
	t.Cleanup(func() {
		if err := container.Terminate(ctx); err != nil {
			t.Fatalf("failed to terminate container: %s", err)
		}
	})

Scope

  • Add a new API method to the library
  • Update unit tests to use the new method
  • Update the documentation, especially QuickStart and examples

References

@oleg-nenashev oleg-nenashev added enhancement New feature or request good first issue Good for newcomers labels Aug 9, 2023
@Vayras
Copy link
Contributor

Vayras commented Aug 9, 2023

Hi @oleg-nenashev I'm currently learning Go and would like to work on this issue can you assign me this issue and tell me about the project structure?

@oleg-nenashev
Copy link
Member Author

@Vayras sure, please feel free to go ahead! The project structure is really simple: just one file and the test file for it in the repository root. The rest are the documentation and the examples that can be updated as we go

@oleg-nenashev oleg-nenashev changed the title Add API for creating a Testcontainer with auto^termination Add API for creating a Testcontainer with auto-termination Aug 9, 2023
@Vayras
Copy link
Contributor

Vayras commented Aug 9, 2023

@oleg-nenashev Thank you for letting me know , working on this issue now

@Vayras
Copy link
Contributor

Vayras commented Aug 9, 2023

I have created a pull request for this issue

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

No branches or pull requests

2 participants