Skip to content

Commit c1c2cb1

Browse files
committed
justfile
1 parent d5c0289 commit c1c2cb1

File tree

10 files changed

+266
-29
lines changed

10 files changed

+266
-29
lines changed

.github/workflows/wasp-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
test-type: ['wasp-test-race', 'wasp-test-benchspy']
11+
test-type: ['TestBenchSpy', 'TestSmoke']
1212
defaults:
1313
run:
1414
working-directory: wasp
@@ -42,6 +42,7 @@ jobs:
4242
go-modules-${{ runner.os }}
4343
- name: Install dependencies
4444
run: go mod download
45+
- uses: extractions/setup-just@v2
4546
- name: Run tests
4647
run: |
47-
devbox run ${{ matrix.test-type }}
48+
just test wasp ${{ matrix.test-type }}

devbox.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
2929
"k9s@latest",
3030
31-
31+
32+
3233
],
3334
"shell": {
3435
"init_hook": [

devbox.lock

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,90 @@
10641064
}
10651065
}
10661066
},
1067+
1068+
"last_modified": "2025-02-20T02:45:56Z",
1069+
"resolved": "github:NixOS/nixpkgs/dad564433178067be1fbdfcce23b546254b6d641#just",
1070+
"source": "devbox-search",
1071+
"version": "1.39.0",
1072+
"systems": {
1073+
"aarch64-darwin": {
1074+
"outputs": [
1075+
{
1076+
"name": "out",
1077+
"path": "/nix/store/i7apaf6fa4aswha9xs45jdil3wn038vq-just-1.39.0",
1078+
"default": true
1079+
},
1080+
{
1081+
"name": "man",
1082+
"path": "/nix/store/27f6bblm28j80c2xbc75j72fl4anbyxm-just-1.39.0-man",
1083+
"default": true
1084+
},
1085+
{
1086+
"name": "doc",
1087+
"path": "/nix/store/13ixl7w80ymwqc3ykd8wgccjqcf12cdm-just-1.39.0-doc"
1088+
}
1089+
],
1090+
"store_path": "/nix/store/i7apaf6fa4aswha9xs45jdil3wn038vq-just-1.39.0"
1091+
},
1092+
"aarch64-linux": {
1093+
"outputs": [
1094+
{
1095+
"name": "out",
1096+
"path": "/nix/store/j4kprcvca7f41m3rv1134qmbksiqx31n-just-1.39.0",
1097+
"default": true
1098+
},
1099+
{
1100+
"name": "man",
1101+
"path": "/nix/store/6mvjzbbn5nn2nwyf2dxzlkh22x5s3lvh-just-1.39.0-man",
1102+
"default": true
1103+
},
1104+
{
1105+
"name": "doc",
1106+
"path": "/nix/store/rskm7r6g0rri3lv93xrs3vnmm48jf7rf-just-1.39.0-doc"
1107+
}
1108+
],
1109+
"store_path": "/nix/store/j4kprcvca7f41m3rv1134qmbksiqx31n-just-1.39.0"
1110+
},
1111+
"x86_64-darwin": {
1112+
"outputs": [
1113+
{
1114+
"name": "out",
1115+
"path": "/nix/store/blzi4k9jab89qd502pqd2vl5zihiv510-just-1.39.0",
1116+
"default": true
1117+
},
1118+
{
1119+
"name": "man",
1120+
"path": "/nix/store/bgyg97lsdbzwaad96krwh9z39h8rbn7r-just-1.39.0-man",
1121+
"default": true
1122+
},
1123+
{
1124+
"name": "doc",
1125+
"path": "/nix/store/y739nrn1mmarhxsfq7brf1c9x28s0laq-just-1.39.0-doc"
1126+
}
1127+
],
1128+
"store_path": "/nix/store/blzi4k9jab89qd502pqd2vl5zihiv510-just-1.39.0"
1129+
},
1130+
"x86_64-linux": {
1131+
"outputs": [
1132+
{
1133+
"name": "out",
1134+
"path": "/nix/store/dp2kp0z4x2z07ms051ngf3pidwb7gzy7-just-1.39.0",
1135+
"default": true
1136+
},
1137+
{
1138+
"name": "man",
1139+
"path": "/nix/store/raasy0ls098ahzvasirqbym9kqk2qghj-just-1.39.0-man",
1140+
"default": true
1141+
},
1142+
{
1143+
"name": "doc",
1144+
"path": "/nix/store/rciv116xhgapwcas08r2y5jbcck5h1nz-just-1.39.0-doc"
1145+
}
1146+
],
1147+
"store_path": "/nix/store/dp2kp0z4x2z07ms051ngf3pidwb7gzy7-just-1.39.0"
1148+
}
1149+
}
1150+
},
10671151
"k9s@latest": {
10681152
"last_modified": "2025-02-23T09:42:26Z",
10691153
"resolved": "github:NixOS/nixpkgs/2d068ae5c6516b2d04562de50a58c682540de9bf#k9s",

justfile

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
default:
2+
@just --list
3+
4+
seth-build-contracts:
5+
@just seth-solc
6+
cd seth && solc --abi --overwrite -o contracts/abi contracts/NetworkDebugContract.sol
7+
solc --bin --overwrite -o contracts/bin contracts/NetworkDebugContract.sol
8+
abigen --bin=contracts/bin/NetworkDebugContract.bin --abi=contracts/abi/NetworkDebugContract.abi --pkg=network_debug_contract --out=contracts/bind/NetworkDebugContract/NetworkDebugContract.go
9+
solc --abi --overwrite -o contracts/abi contracts/NetworkDebugSubContract.sol
10+
solc --bin --overwrite -o contracts/bin contracts/NetworkDebugSubContract.sol
11+
abigen --bin=contracts/bin/NetworkDebugSubContract.bin --abi=contracts/abi/NetworkDebugSubContract.abi --pkg=network_debug_sub_contract --out=contracts/bind/NetworkDebugSubContract/NetworkDebugSubContract.go
12+
solc --abi --overwrite -o contracts/abi contracts/TestContractOne.sol
13+
solc --bin --overwrite -o contracts/bin contracts/TestContractOne.sol
14+
abigen --bin=contracts/bin/TestContractOne.bin --abi=contracts/abi/TestContractOne.abi --pkg=unique_event_one --out=contracts/bind/TestContractOne/TestContractOne.go
15+
solc --abi --overwrite -o contracts/abi contracts/TestContractTwo.sol
16+
solc --bin --overwrite -o contracts/bin contracts/TestContractTwo.sol
17+
abigen --bin=contracts/bin/TestContractTwo.bin --abi=contracts/abi/TestContractTwo.abi --pkg=unique_event_two --out=contracts/bind/TestContractTwo/TestContractTwo.go
18+
19+
seth-solc:
20+
cd seth && solc-select install 0.8.19
21+
solc-select use 0.8.19
22+
23+
seth-anvil-sync:
24+
cd seth && anvil
25+
26+
seth-anvil:
27+
cd seth && anvil > /dev/null 2>&1 &
28+
29+
seth-geth:
30+
cd seth && rm -rf geth_data/geth
31+
geth init --datadir geth_data/ geth_data/clique_genesis.json
32+
geth --graphql --http --http.api admin,debug,web3,eth,txpool,personal,miner,net --http.corsdomain "*" --ws --ws.api admin,debug,web3,eth,txpool,personal,miner,net --ws.origins "*" --mine --miner.etherbase 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --unlock f39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --allow-insecure-unlock --datadir ./geth_data --password geth_data/password.txt --nodiscover --vmdebug --networkid 1337 > /dev/null 2>&1 &
33+
34+
seth-geth-sync:
35+
cd seth && rm -rf geth_data/geth
36+
geth init --datadir geth_data/ geth_data/clique_genesis.json
37+
geth --graphql --http --http.api admin,debug,web3,eth,txpool,personal,miner,net --http.corsdomain "*" --ws --ws.api admin,debug,web3,eth,txpool,personal,miner,net --ws.origins "*" --mine --miner.etherbase 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --unlock f39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --allow-insecure-unlock --datadir ./geth_data --password geth_data/password.txt --nodiscover --vmdebug --networkid 1337
38+
39+
seth-test-anvil:
40+
@just seth-anvil
41+
cd seth && SETH_URL=http://localhost:8545 SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestSmoke || pkill -f anvil
42+
43+
seth-test-geth:
44+
@just seth-geth
45+
cd seth && SETH_URL=ws://localhost:8546 SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestSmoke || pkill -f geth
46+
47+
seth-test-anvil-api:
48+
@just seth-anvil
49+
cd seth && SETH_URL=http://localhost:8545 SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestAPI || pkill -f anvil
50+
51+
seth-test-geth-api:
52+
@just seth-geth
53+
cd seth && SETH_URL=ws://localhost:8546 SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestAPI || pkill -f geth
54+
55+
seth-test-anvil-trace:
56+
@just seth-anvil
57+
cd seth && SETH_URL=http://localhost:8545 SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestTrace || pkill -f anvil
58+
59+
seth-test-geth-trace:
60+
@just seth-geth
61+
cd seth && SETH_URL=ws://localhost:8546 SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestTrace || pkill -f geth
62+
63+
seth-test-anvil-cli:
64+
@just seth-anvil
65+
cd seth && SETH_URL=http://localhost:8545 SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestCLI || pkill -f anvil
66+
67+
seth-test-geth-cli:
68+
@just seth-geth
69+
cd seth && SETH_URL=ws://localhost:8546 SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestCLI || pkill -f geth
70+
71+
seth-test-anvil-others:
72+
@just seth-anvil
73+
cd seth && SETH_URL=http://localhost:8545 SETH_CONFIG_PATH="seth.toml" SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run "TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract|TestConfig" || pkill -f anvil
74+
75+
seth-test-geth-others:
76+
@just seth-geth
77+
cd seth && SETH_URL=ws://localhost:8546 SETH_CONFIG_PATH="seth.toml" SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run "TestContractMap|TestGasEstimator|TestRPCHealthCheck|TestUtil|TestContract|TestConfig" || pkill -f geth
78+
79+
seth-test-anvil-gas-bumping:
80+
@just seth-anvil
81+
cd seth && SETH_URL=http://localhost:8545 SETH_NETWORK=Anvil SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestGasBumping || pkill -f anvil
82+
83+
seth-test-geth-gas-bumping:
84+
@just seth-anvil
85+
cd seth && SETH_URL=ws://localhost:8546 SETH_NETWORK=Geth SETH_ROOT_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 go test -v -count 1 -race `go list ./... | grep -v examples` -run TestGasBumping || pkill -f anvil
86+
87+
88+
framework-test-components:
89+
cd framework && go test -timeout 5m -count 1 -run TestComponentDocker ./...
90+
91+
92+
install:
93+
pre-commit install
94+
95+
# Lint
96+
lint dir_path:
97+
cd {{dir_path}} && golangci-lint --color=always run -v -c {{invocation_directory()}}/.golangci.yaml
98+
99+
lint-all:
100+
@just lint framework
101+
@just lint parrot
102+
@just lint wasp
103+
@just lint seth
104+
@just lint havoc
105+
@just lint k8s-test-runner
106+
@just lint lib
107+
@just lint tools/workflowresultparser
108+
@just lint tools/asciitable
109+
@just lint tools/ghlatestreleasechecker
110+
@just lint tools/testlistgenerator
111+
@just lint tools/ecrimagefetcher
112+
@just lint tools/gotestloghelper
113+
114+
115+
# Default test command
116+
_default_test dir test_regex:
117+
cd {{dir}} && go test -v -coverprofile cover.out -race -count 1 `go list ./... | grep -v examples` -run {{test_regex}}
118+
119+
# Wasp test command
120+
test dir_path test_regex:
121+
just _default_test {{dir_path}} {{test_regex}}
122+
123+
cover dir_path:
124+
cd {{dir_path}} && go tool cover -html cover.out
125+
126+
wasp-test-benchspy:
127+
cd wasp && ./scripts/run_benchspy_tests.sh
128+
129+
wasp-test-cover:
130+
cd wasp && go test -v -coverprofile cover.out -count 1 `go list ./... | grep -v examples` -run TestSmoke
131+
go tool cover -html cover.out
132+
133+
wasp-test-loki:
134+
cd wasp && go test -v -count 1 `go list ./... | grep -v examples` -run TestPerfRenderLoki
135+
136+
wasp-test-pyro-rps:
137+
cd wasp && go test -v -run TestPyroscopeLocalTraceRPSCalls -trace trace.out
138+
139+
wasp-test-pyro-vu:
140+
cd wasp && go test -v -run TestPyroscopeLocalTraceVUCalls -trace trace.out
141+
142+
wasp-dashboard:
143+
cd wasp && go run dashboard/cmd/main.go
144+
145+
# utility
146+
pre-commit:
147+
pre-commit run --hook-stage pre-commit --show-diff-on-failure --color=always
148+
149+
modgraph:
150+
go install github.com/jmank88/gomods@v0.1.5
151+
go install github.com/jmank88/modgraph@v0.1.0
152+
./modgraph > go.md
153+
git diff --minimal --exit-code
154+
155+
install-loghelper:
156+
go install github.com/smartcontractkit/chainlink-testing-framework/tools/gotestloghelper@latest
157+
158+
gomods-atidy:
159+
go install github.com/jmank88/gomods@v0.1.5
160+
gomods tidy
161+
162+
# CI
163+
gomods-tidy-ci:
164+
go install github.com/jmank88/gomods@v0.1.5 && gomods tidy
165+
git add --all
166+
git diff --minimal --cached --exit-code

lib/blockchain/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func LoadNetworkFromEnvironment() EVMNetwork {
9898
return network
9999
}
100100

101-
// ToMap marshalls the network's values to a generic map, useful for setting env vars on instances like the remote runner
101+
// ToMap marshals the network's values to a generic map, useful for setting env vars on instances like the remote runner
102102
// Map Structure
103103
// "envconfig_key": stringValue
104104
func (e *EVMNetwork) ToMap() map[string]interface{} {

lib/docker/test_env/zookeeper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (z *Zookeeper) StartContainer() error {
7272
}
7373
c, err := tc.GenericContainer(testcontext.Get(z.t), req)
7474
if err != nil {
75-
return fmt.Errorf("cannot start Zookeper container: %w", err)
75+
return fmt.Errorf("cannot start Zookeeper container: %w", err)
7676
}
7777
name, err := c.Name(testcontext.Get(z.t))
7878
if err != nil {
@@ -83,7 +83,7 @@ func (z *Zookeeper) StartContainer() error {
8383

8484
z.l.Info().Str("containerName", name).
8585
Str("internalUrl", z.InternalUrl).
86-
Msgf("Started Zookeper container")
86+
Msgf("Started Zookeeper container")
8787

8888
z.Container = c
8989

lib/k8s/environment/environment.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,9 @@ func (m *Environment) ReplaceHelm(name string, chart ConnectedChart) (*Environme
531531
}
532532

533533
func addDefaultPodAnnotationsAndLabels(h cdk8s.Helm, annotations, labels map[string]string) {
534-
annoatationsCopy := map[string]string{}
534+
annotationsCopy := map[string]string{}
535535
for k, v := range annotations {
536-
annoatationsCopy[k] = v
536+
annotationsCopy[k] = v
537537
}
538538
for _, ao := range *h.ApiObjects() {
539539
if ao.Kind() == nil {
@@ -568,14 +568,14 @@ func addDefaultPodAnnotationsAndLabels(h cdk8s.Helm, annotations, labels map[str
568568
continue
569569
}
570570
for k, v := range annot {
571-
annoatationsCopy[k] = v.(string)
571+
annotationsCopy[k] = v.(string)
572572
}
573573
}
574574
annotationPath := "/spec/template/metadata/annotations"
575575
if strings.EqualFold("cronjob", kind) {
576576
annotationPath = "/spec/jobTemplate/spec/template/metadata/annotations"
577577
}
578-
ao.AddJsonPatch(cdk8s.JsonPatch_Add(ptr.Ptr(annotationPath), annoatationsCopy))
578+
ao.AddJsonPatch(cdk8s.JsonPatch_Add(ptr.Ptr(annotationPath), annotationsCopy))
579579

580580
// loop over the labels and apply them to both the labels and selectors
581581
// these should in theory always have at least one label/selector combo in existence so we don't

lib/k8s/imports/k8s/k8s.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44179,7 +44179,7 @@ type RoleRefV1Alpha1 struct {
4417944179
type RollingUpdateDaemonSet struct {
4418044180
// The maximum number of nodes with an existing available DaemonSet pod that can have an updated DaemonSet pod during during an update.
4418144181
//
44182-
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediatedly created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate.
44182+
// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). This can not be 0 if MaxUnavailable is 0. Absolute number is calculated from percentage by rounding up to a minimum of 1. Default value is 0. Example: when this is set to 30%, at most 30% of the total number of nodes that should be running the daemon pod (i.e. status.desiredNumberScheduled) can have their a new pod created before the old pod is marked as deleted. The update starts by launching new pods on 30% of nodes. Once an updated pod is available (Ready for at least minReadySeconds) the old DaemonSet pod on that node is marked deleted. If the old pod becomes unavailable for any reason (Ready transitions to false, is evicted, or is drained) an updated pod is immediately created on that node without considering surge limits. Allowing surge implies the possibility that the resources consumed by the daemonset on any given node can double if the readiness check fails, and so resource intensive daemonsets should take into account that they may cause evictions during disruption. This is beta field and enabled/disabled by DaemonSetUpdateSurge feature gate.
4418344183
MaxSurge IntOrString `field:"optional" json:"maxSurge" yaml:"maxSurge"`
4418444184
// The maximum number of DaemonSet pods that can be unavailable during the update.
4418544185
//
@@ -45029,7 +45029,7 @@ type TokenRequest struct {
4502945029

4503045030
// TokenRequestSpec contains client provided parameters of a token request.
4503145031
type TokenRequestSpec struct {
45032-
// Audiences are the intendend audiences of the token.
45032+
// Audiences are the intended audiences of the token.
4503345033
//
4503445034
// A recipient of a token must identitfy themself with an identifier in the list of audiences of the token, and otherwise should reject the token. A token issued for multiple audiences may be used to authenticate against any of the audiences listed but implies a high degree of trust between the target audiences.
4503545035
Audiences *[]*string `field:"required" json:"audiences" yaml:"audiences"`

wasp/.golangci.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

wasp/benchspy/loki_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ func TestBenchSpy_LokiQueryExecutor_IsComparable(t *testing.T) {
108108
})
109109

110110
t.Run("different types", func(t *testing.T) {
111-
invalidExector := &anotherQueryExecutor{}
111+
invalidExecutor := &anotherQueryExecutor{}
112112

113-
err := executor1.IsComparable(invalidExector)
113+
err := executor1.IsComparable(invalidExecutor)
114114
assert.Error(t, err)
115115
})
116116

0 commit comments

Comments
 (0)