Skip to content

Commit

Permalink
all good
Browse files Browse the repository at this point in the history
  • Loading branch information
technicallyty committed Mar 8, 2025
1 parent 77e0a84 commit 1fe91c9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -504,30 +504,31 @@ test-system: build-v50 build
$(MAKE) -C tests/systemtests test
.PHONY: test-system

# build-v50 checks out the v0.50.x branch, builds the binary, and renames it to simdv50.
build-v50:
@echo "Stashing any uncommitted changes..."
@echo "stashing any uncommitted changes..."
STASH_RESULT=$$(git stash push -m "Temporary stash for v50 build" 2>&1) && \
STASHED=false && \
if ! echo "$$STASH_RESULT" | grep -q "No local changes to save"; then \
if ! echo "$$STASH_RESULT" | grep -q "no local changes to save"; then \
STASHED=true; \
fi && \
echo "Saving current reference..." && \
echo "saving current reference..." && \
CURRENT_REF=$$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse HEAD) && \
echo "Checking out release branch..." && \
echo "checking out release branch..." && \
git checkout release/v0.50.x && \
echo "Building v50 binary..." && \
echo "building v50 binary..." && \
make build && \
mv build/simd build/simdv50 && \
echo "Returning to original branch..." && \
echo "returning to original branch..." && \
if [ "$$CURRENT_REF" = "HEAD" ]; then \
git checkout $$(git rev-parse HEAD); \
else \
git checkout $$CURRENT_REF; \
fi && \
if [ "$$STASHED" = "true" ]; then \
echo "Reapplying stashed changes..." && \
echo "reapplying stashed changes..." && \
git stash pop; \
else \
echo "No stashed changes to reapply."; \
echo "no stashed changes to reapply."; \
fi
.PHONY: build-v50
12 changes: 5 additions & 7 deletions systemtests/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type SystemUnderTest struct {
out io.Writer
verbose bool
ChainStarted bool
ProjectName string
projectName string
dirty bool // requires full reset when marked dirty

pidsLock sync.RWMutex
Expand All @@ -99,7 +99,7 @@ func NewSystemUnderTest(execBinary string, verbose bool, nodesCount int, blockTi
out: os.Stdout,
verbose: verbose,
minGasPrice: fmt.Sprintf("0.000001%s", sdk.DefaultBondDenom),
ProjectName: "simd",
projectName: "simd",
pids: make(map[int]struct{}, nodesCount),
}
if len(initer) > 0 {
Expand Down Expand Up @@ -143,10 +143,9 @@ func (s *SystemUnderTest) SetupChain() {
}
s.testnetInitializer.Initialize()
s.nodesCount = s.initialNodesCount
workDir := WorkDir

// modify genesis with system test defaults
src := filepath.Join(workDir, s.nodePath(0), "config", "genesis.json")
src := filepath.Join(WorkDir, s.nodePath(0), "config", "genesis.json")
genesisBz, err := os.ReadFile(src) // #nosec G304
if err != nil {
panic(fmt.Sprintf("failed to load genesis: %s", err))
Expand Down Expand Up @@ -620,8 +619,7 @@ func (s *SystemUnderTest) awaitProcessCleanup(cmd *exec.Cmd) {

func (s *SystemUnderTest) withEachNodeHome(cb func(i int, home string)) {
for i := 0; i < s.nodesCount; i++ {
p := s.nodePath(i)
cb(i, p)
cb(i, s.nodePath(i))
}
}

Expand All @@ -632,7 +630,7 @@ func (s *SystemUnderTest) NodeDir(i int) string {

// nodePath returns the path of the node within the work dir. not absolute
func (s *SystemUnderTest) nodePath(i int) string {
return NodePath(i, s.outputDir, s.ProjectName)
return NodePath(i, s.outputDir, s.projectName)
}

func NodePath(n int, outputDir, name string) string {
Expand Down
2 changes: 1 addition & 1 deletion systemtests/testnet_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func NewModifyConfigYamlInitializer(exec string, s *SystemUnderTest) *ModifyConf
minGasPrice: s.minGasPrice,
commitTimeout: s.CommitTimeout(),
log: s.Log,
projectName: s.ProjectName,
projectName: s.projectName,
}
}

Expand Down

0 comments on commit 1fe91c9

Please sign in to comment.