Skip to content

Commit 9431814

Browse files
committed
Use example package for wasm test
1 parent 41db650 commit 9431814

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Makefile

+10-4
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ endif
1313

1414
api_dir := ./proto/api
1515
example_file := ./example/example
16-
wasm_file := ./test/wasm/test.wasm
16+
test_dir := ./test/
17+
wasm_dir := ${test_dir}/wasm
18+
wasm_file := ${wasm_dir}/test.wasm
1719

1820
.PHONY: all test clean example
1921

2022
all: capnp example test
2123

22-
clean: capnp-clean example-clean
24+
clean: capnp-clean example-clean test-clean
2325

2426

2527
capnp: capnp-raft
@@ -43,5 +45,9 @@ test: test-wasm example example-clean
4345

4446
# Test that everything can be compiled to wasm
4547
test-wasm:
46-
@env GOOS=wasip1 GOARCH=wasm ${GO} build -o ${wasm_file} ./test/wasm
47-
@rm ${wasm_file}
48+
@mkdir -p ${wasm_dir}
49+
@env GOOS=wasip1 GOARCH=wasm ${GO} build -o ${wasm_file} ./example
50+
@rm -rf ${wasm_dir}
51+
52+
test-clean:
53+
@rm -rf ${wasm_dir}

raft/node.go

+1
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ func (n *Node) retrieveWithTimeout(ctx context.Context, id uint64, timeout time.
355355
case <-ctx.Done():
356356
err = ctx.Err()
357357
}
358+
358359
return node, err
359360
}
360361

0 commit comments

Comments
 (0)