diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 35e2d0b..5ffcb52 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -5,6 +5,7 @@ on: - main jobs: + # this tests the basic commands without checking the output actions: runs-on: depot-ubuntu-22.04-4 env: @@ -83,6 +84,9 @@ jobs: echo "E2E Tests Complete" + # this runs 2 commands that require user input, + # the `overmind terraform plan` subcommand has to be run first and succeed before the `overmind terraform apply` subcommand can be run + # the lost pixel tapes have built in sleeps to wait for commands to complete interactive: runs-on: depot-ubuntu-22.04-4 env: @@ -140,7 +144,7 @@ jobs: terraform init cp -a $(which terraform) . # provide a terraform binary to the containers below - + # see the workflow file for an explanation of what is happening here docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_SESSION_TOKEN -e HONEYCOMB_API_KEY -e OVM_API_KEY -e TEABUG -v $PWD:/vhs -v ~/.aws:/root/.aws ghcr.io/charmbracelet/vhs /vhs/.github/e2eplan.tape docker run --rm -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_DEFAULT_REGION -e AWS_REGION -e AWS_SESSION_TOKEN -e HONEYCOMB_API_KEY -e OVM_API_KEY -e TEABUG -v $PWD:/vhs -v ~/.aws:/root/.aws ghcr.io/charmbracelet/vhs /vhs/.github/e2eapply.tape diff --git a/cmd/pterm.go b/cmd/pterm.go index e04867c..38e78db 100644 --- a/cmd/pterm.go +++ b/cmd/pterm.go @@ -137,6 +137,10 @@ func RunRevlinkWarmup(ctx context.Context, oi sdp.OvermindInstance, postPlanPrin if spinner != nil { spinner.Success("Discovered and linked all resources") + } else { + // if we didn't have a spinner, print a success message + // this can happen if the terminal is not available, or if the revlink warmup is very fast + pterm.Success.Println("Discovered and linked all resources") } return nil diff --git a/cmd/terraform_plan.go b/cmd/terraform_plan.go index ff72bf0..7db3c8a 100644 --- a/cmd/terraform_plan.go +++ b/cmd/terraform_plan.go @@ -177,10 +177,19 @@ func TerraformPlanImpl(ctx context.Context, cmd *cobra.Command, oi sdp.OvermindI resourceExtractionSpinner.Success() - // wait for the revlink warmup to finish before we update the planned changes - err = revlinkPool.Wait() - if err != nil { - return fmt.Errorf("error waiting for revlink warmup: %w", err) + // wait for the revlink warmup for 15 seconds. if it takes longer, we'll just continue + waitCh := make(chan error, 1) + go func() { + waitCh <- revlinkPool.Wait() + }() + + select { + case err = <-waitCh: + if err != nil { + return fmt.Errorf("error waiting for revlink warmup: %w", err) + } + case <-time.After(15 * time.Second): + pterm.Info.Print("Done waiting for revlink warmup") } ///////////////////////////////////////////////////////////////////