Skip to content

[Enhancement]: Simpler API for Docker compose UP & DOWN #3259

@aggarwalpiyush01

Description

@aggarwalpiyush01

Proposal

Proposal

  • Add a simpler wrapper API to start & shut down Docker Compose.

      servicesToPrintLogsFor := []string{"service-1"}
      waitStrategies := map[string]wait.Strategy{
		"service-1":   wait.NewLogStrategy(" ... ...").WithStartupTimeout(60 * time.Second).WithPollInterval(1 * time.Millisecond),
		"service-2":            wait.NewLogStrategy("... ...").WithStartupTimeout(60 * time.Second).WithPollInterval(1 * time.Millisecond),
	}
	dockerComposeDown, e := tc.DockerComposeUp(dockerComposeFilePath, waitStrategies)
	defer dockerComposeDown(servicesToPrintLogsFor)

	if e != nil {
		return fmt.Errorf("error when attempting to setup & run compose stack: %w", e)
	}

Why?

  • There are many users who for the most simplest of testing needs require only a simple API to start & shut down their docker compose as part of their test setup & teardown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions