Skip to content

Commit

Permalink
Fix go-integration-tests in Github CI workflow. (#3047)
Browse files Browse the repository at this point in the history
* Fix go-integration-tests in Github CI workflow.

Remove Armada 'server' as dependency for 'executor' startup, and
have the former wait 30 seconds before starting, so the Executor
should be running and healthy.  Also save docker-compose logs and
Pulsar container logs to GH artifacts for debugging purposes.

Signed-off-by: Rich Scott <[email protected]>

* Specify 'ubuntu-latest-4-cores' as runner for CI tests.

Signed-off-by: Rich Scott <[email protected]>

* Docker-Compose: Sleep 30 seconds before starting Armada server

Also, remove troublesome and redundant createQueue() call - the call to
CheckForArmadaRunning() immediately after it inovkes createQueue()
first. Also, sleep 30 thirty seconds before creating the queue, to
ensure that the Armada server is fully up and running.

Signed-off-by: Rich Scott <[email protected]>

---------

Signed-off-by: Rich Scott <[email protected]>
  • Loading branch information
richscott authored Oct 16, 2023
1 parent ee19efb commit d5bbd47
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
ts-unit-tests:
name: TypeScript Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores

steps:
- name: Checkout
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:

go-unit-tests:
name: Golang Unit Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores

steps:
- name: Checkout
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:

go-integration-tests:
name: Golang Integration Tests
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores

env:
ARMADA_EXECUTOR_INGRESS_URL: "http://localhost"
Expand Down Expand Up @@ -131,6 +131,22 @@ jobs:
path: junit.xml
if-no-files-found: error

- name: Store Docker Logs
if: always()
run: |
mkdir -p ./logs
docker compose logs --no-color > ./logs/docker-compose.log
docker logs pulsar > ./logs/pulsar.log 2>&1
- name: Upload Docker Compose Logs
uses: actions/upload-artifact@v3
if: always()
with:
name: docker-compose-logs
path: |
./logs/
if-no-files-found: error

- name: Publish JUnit Report
uses: mikepenz/action-junit-report@v3
if: always()
Expand All @@ -143,7 +159,7 @@ jobs:

go-mod-up-to-date:
name: Golang Mod Up To Date
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores

steps:
- name: Checkout code
Expand Down Expand Up @@ -182,7 +198,7 @@ jobs:
proto-up-to-date:
name: Proto Up To Date
runs-on: ubuntu-22.04
runs-on: ubuntu-latest-4-cores

steps:
- name: Checkout
Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ services:
working_dir: /app
env_file:
- ./developer/env/server.env
command: ./server --config /config/insecure-armada.yaml
command: sh -c "sleep 30 && ./server --config /config/insecure-armada.yaml"

server-pulsar:
container_name: server
Expand Down Expand Up @@ -141,8 +141,6 @@ services:
ports:
- 9001:9001
- 4001:4000
depends_on:
- server
volumes:
- ./.kube/internal:/.kube
- "go-cache:/root/.cache/go-build:rw"
Expand Down
2 changes: 1 addition & 1 deletion magefiles/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ func createQueue() error {

// Build images, spin up a test environment, and run the integration tests against it.
func TestSuite() error {
mg.Deps(createQueue)
mg.Deps(CheckForArmadaRunning)

// Only set these if they have not already been set
Expand All @@ -52,6 +51,7 @@ func TestSuite() error {

// Checks if Armada is ready to accept jobs.
func CheckForArmadaRunning() error {
time.Sleep(30 * time.Second)
mg.Deps(createQueue)

// Set high to take compile time into account
Expand Down

0 comments on commit d5bbd47

Please sign in to comment.