Skip to content

Commit

Permalink
test: improve test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond committed Apr 26, 2024
1 parent 9b983d1 commit e732f03
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/software-upgrade-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:
- name: Chain initialization
run: |
cp -a scripts/upgrade-assure/types.go scripts/upgrade-assure-skip/types.go
go run ./scripts/upgrade-assure-skip/... $SNAPSHOT_PATH $OLD_BINARY_PATH $NEW_BINARY_PATH --skip-node-start
GOMEMLIMIT=16GiB go run ./scripts/upgrade-assure-skip/... $SNAPSHOT_PATH $OLD_BINARY_PATH $NEW_BINARY_PATH --skip-node-start
- name: Check out new branch
run: git checkout ${{ github.head_ref }}

- name: Software upgrade
run: |
go run ./scripts/upgrade-assure/... $SNAPSHOT_PATH $OLD_BINARY_PATH $NEW_BINARY_PATH --skip-snapshot --skip-chain-init
GOMEMLIMIT=16GiB go run ./scripts/upgrade-assure/... $SNAPSHOT_PATH $OLD_BINARY_PATH $NEW_BINARY_PATH --skip-snapshot --skip-chain-init
11 changes: 1 addition & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# This workflow file defines a job named test that runs on Ubuntu and is triggered
# on push and pull request events.
#
# The job checks out the repository code, sets up Go with version 1.20, installs
# the project dependencies, and runs the unit tests using `go test`.
#
# The purpose of this workflow file is to automate the process of running unit tests
# for the Elys codebase whenever code changes are pushed or a pull request is opened.

name: Run unit tests
on: push

Expand All @@ -29,4 +20,4 @@ jobs:
- name: Run unit tests
run: |
go test ./...
make ci-test-unit
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,18 @@ test-unit:
@echo Running unit tests...
@GOFLAGS=$(GOFLAGS) go test -race -failfast -v ./...

## ci-test-unit: Run unit tests
ci-test-unit:
@echo Running unit tests via CI...
@GOFLAGS=$(GOFLAGS) GOMEMLIMIT=16GiB go test -race -cpu=4 -failfast -v ./...

## clean: Clean build files. Runs `go clean` internally.
clean:
@echo Cleaning build cache...
@rm -rf $(BUILD_FOLDER) 2> /dev/null
@go clean ./...

.PHONY: mocks test-unit clean
.PHONY: mocks test-unit ci-test-unit clean

## go-mod-cache: Retrieve the go modules and store them in the local cache
go-mod-cache: go.sum
Expand Down

0 comments on commit e732f03

Please sign in to comment.