Skip to content

Commit

Permalink
feat : add github actions tests workflow (#40)
Browse files Browse the repository at this point in the history
* feat: added transactions

* feat: implement client

* fix tx issue

* feat: pause previous code

* adding client injection

* custom txclient

* fix: client issue debug

* new chain client

* debug client init

* update create client

* import mnemonic

* docs

* Update README.md

* update docs

* execute submit tx through client

* fix keyring issue

* import key

* fix

* refactor

* update submitblob tx

* new query

* feat: changes

* handle error

* post data to da

* execute update tx after da submission

* fix

* query and tx

* update msg

* feat: fixed range errors

* feat: vote extensions

* refactor core lgic

* feat: enable vote extensions

* feat: enable vote extensions

* feat: fix vote extensions bug

* feat: fix vote extensions bug

* fix: config script for vote extension height

* fix typo

* fix client

* feat: enable vote extensions

* remove deadcode

* feat: light client data verification

* feat: enable light client verification

* fix

* add unit tests

* add integration test suite

* add integration tests

* chore: proto-gen

* fix failing tests & improve covereage

* fix imports

* fix lint

* fix lint

* fix lint

* remove gci from lint tests

* add tests to the CI/CD tests

* update tests workflow test

* rm comments

* update workflow action

* update workflow action

* update workflow action

* fix lint

* update workflow

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Stop tracking coverage.out

* ignore coverage.out

* fix tests

* fix tests

* add make test

* rm comments

---------

Co-authored-by: saiteja <[email protected]>
Co-authored-by: PrathyushaLakkireddy <[email protected]>
Co-authored-by: Teja2045 <[email protected]>
Co-authored-by: Prathyusha Lakkireddy <[email protected]>
  • Loading branch information
5 people authored Sep 19, 2024
1 parent c5b8d9b commit 7c3c463
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Tests

on:
pull_request:
push:
branches:
- main

concurrency:
group: ci-${{ github.ref }}-tests
cancel-in-progress: true

jobs:
tests:
name: Tests and code coverage
runs-on: ubuntu-latest
steps:
- name: Install GO
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Checkout code
uses: actions/checkout@v3
- name: run all tests and generate coverage
run: go test -v -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic `go list ./... | grep -v simapp`
- name: Upload codecov report
uses: codecov/[email protected]
with:
file: coverage.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build
coverage.out
39 changes: 38 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,41 @@ clean:
set-testnet-configs:
availd config set client chain-id chainid-1
availd config set client keyring-backend test
availd config set client output text
availd config set client output text


###############################################################################
### Tests & Simulation ###
###############################################################################

test: test-unit
test-all: test-unit test-ledger-mock test-race test-cover

TEST_PACKAGES=./...
TEST_TARGETS := test-unit test-unit-proto test-ledger-mock test-race test-ledger test-race

# Test runs-specific rules. To add a new test target, just add
# a new rule, customise ARGS or TEST_PACKAGES ad libitum, and
# append the new rule to the TEST_TARGETS list.
test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace'
test-ledger: ARGS=-tags='cgo ledger norace'
test-ledger-mock: ARGS=-tags='ledger test_ledger_mock norace'
test-race: ARGS=-race -tags='cgo ledger test_ledger_mock'
test-race: TEST_PACKAGES=$(PACKAGES_NOSIMULATION)
$(TEST_TARGETS): run-tests

# check-* compiles and collects tests without running them
# note: go test -c doesn't support multiple packages yet (https://github.com/golang/go/issues/15513)
CHECK_TEST_TARGETS := check-test-unit
check-test-unit: ARGS=-tags='cgo ledger test_ledger_mock norace'
$(CHECK_TEST_TARGETS): EXTRA_ARGS=-run=none
$(CHECK_TEST_TARGETS): run-tests

run-tests:
ifneq (,$(shell which tparse 2>/dev/null))
go test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse
else
go test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES)
endif

.PHONY: run-tests test test-all $(TEST_TARGETS)

0 comments on commit 7c3c463

Please sign in to comment.