Skip to content

Commit

Permalink
wip2
Browse files Browse the repository at this point in the history
  • Loading branch information
mihaelabalutoiu committed Oct 25, 2023
1 parent 69e0007 commit 2ebbf2e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 2 additions & 2 deletions test/integration/e2e/client_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ func getInstance(apiCli *client.GarmAPI, apiAuthToken runtime.ClientAuthInfoWrit
return &getInstancesResponse.Payload, nil
}

func deleteInstance(apiCli *client.GarmAPI, apiAuthToken runtime.ClientAuthInfoWriter, instanceID string) error {
func deleteInstance(apiCli *client.GarmAPI, apiAuthToken runtime.ClientAuthInfoWriter, instanceID string, forceRemove bool) error {
return apiCli.Instances.DeleteInstance(
clientInstances.NewDeleteInstanceParams().WithInstanceName(instanceID),
clientInstances.NewDeleteInstanceParams().WithInstanceName(instanceID).WithForceRemove(&forceRemove),
apiAuthToken)
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func GracefulCleanup() {
panic(err)
}
for _, instance := range poolInstances {
if err := deleteInstance(cli, authToken, instance.Name); err != nil {
if err := deleteInstance(cli, authToken, instance.Name, true); err != nil {
panic(err)
}
log.Printf("Instance %s deletion initiated", instance.Name)
Expand Down
16 changes: 16 additions & 0 deletions test/integration/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ var (
Enabled: true,
}

repoPoolParams2 = params.CreatePoolParams{
MaxRunners: 2,
MinIdleRunners: 0,
Flavor: "default",
Image: "ubuntu:22.04",
OSType: commonParams.Linux,
OSArch: commonParams.Amd64,
ProviderName: "test_external",
Tags: []string{"repo-runner"},
Enabled: true,
}

orgName = os.Getenv("ORG_NAME")
orgWebhookSecret = os.Getenv("ORG_WEBHOOK_SECRET")
orgPoolParams = params.CreatePoolParams{
Expand Down Expand Up @@ -101,6 +113,10 @@ func main() {
repoPool = e2e.CreateRepoPool(repo.ID, repoPoolParams)
_ = e2e.UpdateRepoPool(repo.ID, repoPool.ID, repoPoolParams.MaxRunners, 1)

repoPool2 := e2e.CreateRepoPool(repo.ID, repoPoolParams2)
_ = e2e.UpdateRepoPool(repo.ID, repoPool2.ID, repoPoolParams2.MaxRunners, 1)


///////////////////
// organizations //
///////////////////
Expand Down

0 comments on commit 2ebbf2e

Please sign in to comment.