Skip to content

Commit

Permalink
fix(bench:message_passing): add missing neva.yml and fix working with…
Browse files Browse the repository at this point in the history
… fs inside go bench func
  • Loading branch information
emil14 committed Jan 25, 2025
1 parent 5323e39 commit 97b2ae3
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 39 deletions.
38 changes: 38 additions & 0 deletions benchmarks/message_passing/bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Remember - Go runs benchmark function twice:
// first time for calibration, second time for actual benchmark.
// This might affect working with relative paths!

package test

import (
"os"
"os/exec"
"testing"

"github.com/stretchr/testify/require"
)

func BenchmarkMessagePassing(b *testing.B) {
// Store original working directory
originalWd, err := os.Getwd()
require.NoError(b, err)

// Change to parent directory
err = os.Chdir("..")
require.NoError(b, err)

// Ensure we return to original directory after benchmark
defer func() {
err := os.Chdir(originalWd)
require.NoError(b, err)
}()

// Reset timer after setup
b.ResetTimer()

for i := 0; i < b.N; i++ {
cmd := exec.Command("neva", "run", "message_passing")
out, err := cmd.CombinedOutput()
require.NoError(b, err, string(out))
}
}
File renamed without changes.
1 change: 1 addition & 0 deletions benchmarks/neva.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
neva: 0.30.2
27 changes: 0 additions & 27 deletions benchmarks/simplest_message_passing/bench_test.go

This file was deleted.

6 changes: 1 addition & 5 deletions e2e/cli/build_windows/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ func TestBuildWindows(t *testing.T) {

cmd = exec.Command("neva", "build", "--target-os=windows", "--target-arch=amd64", "src")
out, err := cmd.CombinedOutput()
require.NoError(t, err)
if code := cmd.ProcessState.ExitCode(); code != 0 {
t.Log(string(out))
t.Fatal("failed to build windows executable")
}
require.NoError(t, err, string(out))
defer func() {
require.NoError(t, os.Remove("output.exe"))
}()
Expand Down
7 changes: 0 additions & 7 deletions e2e/cli/build_windows/src/main.neva

This file was deleted.

0 comments on commit 97b2ae3

Please sign in to comment.