Skip to content

Commit

Permalink
Add just test commands to be used instead go test (#2014)
Browse files Browse the repository at this point in the history
+refactor MLS CGO options to include lib from go file, and supply lib
path by env var
  • Loading branch information
sergekh2 authored Jan 11, 2025
1 parent c716c6f commit 8918082
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 77 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@ jobs:
--name river_postgres_container
steps:
- uses: taiki-e/install-action@just

- name: Cancel previous runs
if: github.event_name != 'schedule'
uses: styfle/[email protected]
Expand Down Expand Up @@ -682,11 +684,8 @@ jobs:
run: ./scripts/register-ca.sh
working-directory: core

- name: Build MLS libs
run: ./scripts/build-mls.sh

- name: Run node tests
run: CGO_LDFLAGS="./libmls_lib.a -ldl" go test -race -timeout 24m -v -parallel 1 -count 1 -p 8 ./...
run: just test-all -race -timeout 24m -parallel 1 -count 1 -p 8
working-directory: core

XChain_Integration:
Expand Down
2 changes: 1 addition & 1 deletion core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN cp -f ../../target/release/libmls* /build

# Build river_node
WORKDIR /build
RUN CGO_LDFLAGS="./libmls_lib.a -ldl" \
RUN CGO_LDFLAGS="-L/build" \
go build \
-trimpath \
-o /bin/river_node \
Expand Down
18 changes: 12 additions & 6 deletions core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Local [CA](#setting-up-local-ca-for-tls) needs to be provisioned.

To list all available commands:

just RUN_ENV=multi
just

There are two local environments available:

Expand Down Expand Up @@ -34,12 +34,18 @@ Just start with existing config and binary:

just RUN_ENV=multi start

There are `run` version of commands that wait for Ctrl-C and stop nodes on exit:
Restart after rebuilding with current changes:

just RUN_ENV=multi config-and-run
just RUN_ENV=multi config-run-tail
just RUN_ENV=multi run
just RUN_ENV=multi run-and-tail
just RUN_ENV=multi restart

# Building and running go tests

MLS lib needs to be built for some tests to run, there are just commands that build and configure lib and then run go tests:

just test ./... # Run go test
just test-all # Run all go tests from module root
just t # Run all tests from current dir
just build-mls # Rebuild mls without running tests

# Installing just

Expand Down
Loading

0 comments on commit 8918082

Please sign in to comment.