Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add upload artifacts and log instance details on timeout exceeded #146

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ jobs:
port: 9997
tunnel_type: http

- name: Create logs directory
if: always()
run: sudo mkdir -p /artifacts-logs && sudo chmod 777 /artifacts-logs

- name: Run integration tests
run: go run ./test/integration/e2e.go
run: go run ./test/integration/e2e.go 2>&1 | tee /artifacts-logs/e2e.log
env:
GARM_BASE_URL: ${{ steps.ngrok.outputs.tunnel-url }}
GARM_USERNAME: admin
Expand All @@ -69,4 +73,11 @@ jobs:
if: always()
run: |
sudo systemctl status garm
sudo journalctl -u garm --no-pager
sudo journalctl -u garm --no-pager 2>&1 | tee /artifacts-logs/garm.log

- name: Upload GARM and e2e logs
if: always()
uses: actions/upload-artifact@v3
with:
name: garm-logs
path: /artifacts-logs
14 changes: 12 additions & 2 deletions test/integration/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,13 @@ func WaitRepoPoolNoInstances() {

func WaitRepoInstance(timeout time.Duration) {
var timeWaited time.Duration = 0
var instance params.Instance

for timeWaited < timeout {
instances, err := listRepoInstances(cli, authToken, repoID)
handleError(err)
if len(instances) > 0 {
instance := instances[0]
instance = instances[0]
log.Printf("instance %s status: %s", instance.Name, instance.Status)
if instance.Status == commonParams.InstanceRunning && instance.RunnerStatus == params.RunnerIdle {
repoInstanceName = instance.Name
Expand All @@ -656,6 +657,10 @@ func WaitRepoInstance(timeout time.Duration) {
time.Sleep(5 * time.Second)
timeWaited += 5
}
instanceDetails, err := getInstance(cli, authToken, instance.Name)
handleError(err)
printResponse(instanceDetails)

log.Fatalf("Failed to wait for repo instance to be ready")
}

Expand Down Expand Up @@ -801,12 +806,13 @@ func WaitOrgPoolNoInstances() {

func WaitOrgInstance(timeout time.Duration) {
var timeWaited time.Duration = 0
var instance params.Instance

for timeWaited < timeout {
instances, err := listOrgInstances(cli, authToken, orgID)
handleError(err)
if len(instances) > 0 {
instance := instances[0]
instance = instances[0]
log.Printf("instance %s status: %s", instance.Name, instance.Status)
if instance.Status == commonParams.InstanceRunning && instance.RunnerStatus == params.RunnerIdle {
orgInstanceName = instance.Name
Expand All @@ -817,6 +823,10 @@ func WaitOrgInstance(timeout time.Duration) {
time.Sleep(5 * time.Second)
timeWaited += 5
}
instanceDetails, err := getInstance(cli, authToken, instance.Name)
handleError(err)
printResponse(instanceDetails)

log.Fatalf("Failed to wait for org instance to be ready")
}

Expand Down