Skip to content

Commit

Permalink
Add build step to integration
Browse files Browse the repository at this point in the history
  • Loading branch information
aditsachde committed Jul 29, 2024
1 parent f8330d5 commit 10783d9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 32 deletions.
51 changes: 22 additions & 29 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,28 @@ name: Integration Test
on: [push]

jobs:
integration-test-s3:
integration:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run integration test
working-directory: integration
run: go test -run ^TestCTIntegration$
strategy:
matrix:
test:
[TestCTIntegration, TestCTFsIntegration]
# [TestCTIntegration, TestCTHammer, TestCTFsIntegration, TestCTFsHammer]

hammer-test-s3:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"

- name: Run integration test
working-directory: integration
run: go test -timeout 2h -run ^TestCTHammer$ -args -long
run: go test -timeout 1h -run ^${{ matrix.test }}$ -args -long

integration-test-fs:
build:
needs: integration
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -38,19 +33,17 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run integration test
working-directory: integration
run: go test -run ^TestCTFsIntegration$

hammer-test-fs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
- name: Build
run: |
mkdir bin && cd bin
GOOS=linux GOARCH=arm64 go build -o itko-monitor-linux-arm64 ../cmd/itko-monitor
GOOS=linux GOARCH=amd64 go build -o itko-monitor-linux-amd64 ../cmd/itko-monitor
GOOS=linux GOARCH=arm64 go build -o itko-submit-linux-arm64 ../cmd/itko-submit
GOOS=linux GOARCH=amd64 go build -o itko-submit-linux-amd64 ../cmd/itko-submit
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
go-version-file: "go.mod"
- name: Run integration test
working-directory: integration
run: go test -timeout 2h -run ^TestCTFsHammer$ -args -long
name: "bin"
path: "bin/"
7 changes: 4 additions & 3 deletions cmd/itko-monitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ import (

func main() {
// Parse the command-line flags
storeDirectory := flag.String("store-directory", "", "Tile storage directory. Must not have a trailing slash.")
storeAddress := flag.String("store-address", "", "Tile storage url. Must end with a trailing slash.")
listenAddress := flag.String("listen-address", "", "IP and port to listen on for incoming connections.")
maskSize := flag.Int("mask-size", 0, "Mask size for the quadtree.")
flag.Parse()

if *storeAddress == "" {
fmt.Println("Error: -store-address flag must be set")
if *storeDirectory == "" || *storeAddress == "" {
fmt.Println("Error: -store-address or -store-address flag must be set")
flag.Usage() // Print the usage message
os.Exit(1) // Exit with a non-zero status
}
Expand All @@ -40,5 +41,5 @@ func main() {
log.Fatalf("failed to bind to address: %v", err)
}

ctmonitor.MainMain(listener, *storeAddress, *maskSize, nil)
ctmonitor.MainMain(listener, *storeDirectory, *storeAddress, *maskSize, nil)
}

0 comments on commit 10783d9

Please sign in to comment.