Skip to content

Commit

Permalink
WIP: Utilize Built binaries to run testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
jamlo committed Oct 28, 2024
1 parent 9a0134d commit 84ae94c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/testcontainers-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ jobs:
- name: Run Go tests in integration test directory
shell: bash
run: |
set -euo pipefail
# TODO: make WebUI happy when compiling
mkdir -p webui/build
echo "hello test" > webui/build/index.html
echo "===> tmp folder contents"
ls -lt tmp
# cd test_integration
# go test -v -count=1 ./...
echo "===> Copy binary to tests assets"
cd tmp
tar -xzf bacalhau_*.tar.gz
cp ./bacalhau ../test_integration/common_assets/bacalhau_bin
# Run tests
cd ../test_integration
go test -v -count=1 ./...
31 changes: 15 additions & 16 deletions test_integration/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package test_integration

import (
"bacalhau/integration_tests/utils"
"context"
"github.com/google/uuid"
"log"
"os"
Expand All @@ -22,20 +21,20 @@ func TestMain(m *testing.M) {
os.Exit(1)
}

ctx := context.Background()
err = utils.CompileBacalhau(ctx, "../main.go")
if err != nil {
log.Println("Error compiling the bacalhau binary: ", err.Error())
os.Exit(1)
}

// TODO: Maybe we do not need to created images, but just inject
// TODO: them with artifacts before container starts the starts (certs and binary and configs)
err = utils.BuildBaseImages(globalTestExecutionId)
if err != nil {
log.Println("Error building base images: ", err.Error())
os.Exit(1)
}
//ctx := context.Background()
//err = utils.CompileBacalhau(ctx, "../main.go")
//if err != nil {
// log.Println("Error compiling the bacalhau binary: ", err.Error())
// os.Exit(1)
//}
//
//// TODO: Maybe we do not need to created images, but just inject
//// TODO: them with artifacts before container starts the starts (certs and binary and configs)
//err = utils.BuildBaseImages(globalTestExecutionId)
//if err != nil {
// log.Println("Error building base images: ", err.Error())
// os.Exit(1)
//}

exitCode := m.Run()

Expand All @@ -46,7 +45,7 @@ func TestMain(m *testing.M) {
}

// TODO: Better cleaning
os.Remove("./common_assets/bacalhau_bin")
//os.Remove("./common_assets/bacalhau_bin")
//Exit with the same code as the test run
os.Exit(exitCode)
}

0 comments on commit 84ae94c

Please sign in to comment.