Commit 915a1a32 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

op-e2e: Build the op-program client upfront (#13095)

Now that multiple test processes are running at once, multiple threads are compiling the op-program client in the tests. This PR builds the client upfront to avoid this condition.
parent d5dfd515
...@@ -898,6 +898,10 @@ jobs: ...@@ -898,6 +898,10 @@ jobs:
- checkout - checkout
- attach_workspace: - attach_workspace:
at: "." at: "."
- run:
name: build op-program-client
command: make op-program-client
working_directory: op-program
- run: - run:
name: run tests name: run tests
no_output_timeout: <<parameters.no_output_timeout>> no_output_timeout: <<parameters.no_output_timeout>>
......
...@@ -2,7 +2,9 @@ package proofs ...@@ -2,7 +2,9 @@ package proofs
import ( import (
"context" "context"
"os"
"os/exec" "os/exec"
"path/filepath"
"strings" "strings"
"testing" "testing"
"time" "time"
...@@ -12,6 +14,15 @@ import ( ...@@ -12,6 +14,15 @@ import (
// BuildOpProgramClient builds the `op-program` client executable and returns the path to the resulting executable // BuildOpProgramClient builds the `op-program` client executable and returns the path to the resulting executable
func BuildOpProgramClient(t *testing.T) string { func BuildOpProgramClient(t *testing.T) string {
clientPath, err := filepath.Abs("../../../op-program/bin/op-program-client")
require.NoError(t, err)
_, err = os.Stat(clientPath)
if err == nil {
return clientPath
}
require.ErrorIs(t, err, os.ErrNotExist)
t.Log("Building op-program-client") t.Log("Building op-program-client")
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
defer cancel() defer cancel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment