From a7c02ca28f44007dccefa82099189460185de711 Mon Sep 17 00:00:00 2001 From: Athira Sabu <102021496+AsabuHere@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:02:04 +0530 Subject: [PATCH] fix: Adding sleep since go test cases are running before mock server is up (#543) # Fixes # A short description of what this PR does. ### Checklist - [x] I acknowledge that all my contributions will be made under the project's license - [ ] Run `make test-docker` - [ ] Verify affected language: - [ ] Generate [twilio-go](https://github.com/twilio/twilio-go) from our [OpenAPI specification](https://github.com/twilio/twilio-oai) using the [build_twilio_go.py](./examples/build_twilio_go.py) using `python examples/build_twilio_go.py path/to/twilio-oai/spec/yaml path/to/twilio-go` and inspect the diff - [ ] Run `make test` in `twilio-go` - [ ] Create a pull request in `twilio-go` - [ ] Provide a link below to the pull request - [ ] I have made a material change to the repo (functionality, testing, spelling, grammar) - [ ] I have read the [Contribution Guidelines](https://github.com/twilio/twilio-oai-generator/blob/main/CONTRIBUTING.md) and my PR follows them - [x] I have titled the PR appropriately - [ ] I have updated my branch with the main branch - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have added the necessary documentation about the functionality in the appropriate .md file - [ ] I have added inline documentation to the code I modified If you have questions, please create a GitHub Issue in this repository. --- examples/go/Dockerfile | 4 ++-- examples/go/go-client/go.mod | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/go/Dockerfile b/examples/go/Dockerfile index 8372277fa..5872a8cca 100644 --- a/examples/go/Dockerfile +++ b/examples/go/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18 +FROM golang:1.20 ENV GOPATH /go @@ -9,4 +9,4 @@ RUN go get -u github.com/twilio/twilio-go@main RUN go get -u github.com/twilio/terraform-provider-twilio@main # pipefail prevents errors in a pipeline from being masked. -CMD ["/bin/bash", "-c", "set -o pipefail && go test -race ./... -coverprofile /local/coverage.out -json | tee /local/test-report.out"] +CMD ["/bin/bash", "-c", "sleep 25 && set -o pipefail && go test -race ./... -coverprofile /local/coverage.out -json | tee /local/test-report.out"] diff --git a/examples/go/go-client/go.mod b/examples/go/go-client/go.mod index 73b7ff1b4..acecc3755 100644 --- a/examples/go/go-client/go.mod +++ b/examples/go/go-client/go.mod @@ -1,6 +1,6 @@ module go-client -go 1.18 +go 1.20 require ( github.com/golang/mock v1.6.0