Skip to content

Commit

Permalink
Fix cmd Tests (#1968)
Browse files Browse the repository at this point in the history
* [1760]: Turn off address caching in Test_TestnetCmd because it's caching addresses with the wrong hrp for other tests. This doesn't show up if running tests one file at a time, but causes panics when all the tests in that package are run together.

* [1760]: Fix some config unit tests that started failing because they were using fields that no longer exist.

* [1760]: Update the config get and changed sub-commands to check all the configs for entries, possibly outputting multiple.

* [1760]: Start renaming all the tendermint and tm stuff in the config command. Deprecate 'tendermint' and 'tm' as options for 'get' and 'changed', and add 'cometbft', 'comet', and 'cmt' as options.

* [1760]: Set the correct TMCoreSemVer variable when building.

* [1760]: Take the tendermint libraries off the allowed import list. Update CONTRIBUTING and SECURITY for the change from tendermint to cometbft.

* [1760]: Fix the rest of the tendermint references.

* [1760]: Tweak the config get tests to check the current output against a previous value in order to identify fields that were added, removed, renamed, or have new default values.

* [1760]: Update pre-upgrade command to change the broadcast mode from block to sync. Make the client config defaults public variables (instead of private consts) so we can update them dynamically if needed.

* [1760]: Change the default keyring backend to os, but keep it as test for testnets. Add/Update unit tests for the broadcast mode and keyring backend changes, as well as for the pre-upgrade command changes."

* [1760]: Move the setting of the default keyring backend to inside the interceptor so that it can get used when loading the files.

* [1760]: Fix a gofmt thing in  internal/handlers/aggregate_events_test.go.

* [1760]: Add a comment to Test_TestnetCmd explaining why address caching is disabled.

* [1760]: Make the config get and changed commands also look for sub-field matches and loose matches.

* [1760]: Fix a couple unit tests that, when run together, were ending up with the wrong default keyring backend.

* [1760]: Remove cmd/provenanced/cmd from the expected failures in the test github action.

* [1760]: Add changelog entries.
  • Loading branch information
SpicyLemon committed May 15, 2024
1 parent 6b0c442 commit ca0ec9c
Show file tree
Hide file tree
Showing 30 changed files with 1,110 additions and 690 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,13 @@ jobs:
# TODO[1760]: Re-analyze how long tests tests take and change the splitting back to be based on speed.
run: |
grep -vF \
-e 'github.com/provenance-io/provenance/cmd/provenanced/cmd' \
-e 'github.com/provenance-io/provenance/x/ibchooks' \
-e 'github.com/provenance-io/provenance/x/ibcratelimit/module' \
-e 'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
-e 'github.com/provenance-io/provenance/x/oracle/simulation' \
pkgs.txt > pkgs.txt.tmp
split -d -n l/3 pkgs.txt.tmp pkgs.txt.part.
printf '%s\n' \
'github.com/provenance-io/provenance/cmd/provenanced/cmd' \
'github.com/provenance-io/provenance/x/ibchooks' \
'github.com/provenance-io/provenance/x/ibcratelimit/module' \
'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
Expand Down
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,6 @@ linters-settings:
- github.com/cometbft/cometbft/types/time
- github.com/cometbft/cometbft-db

- github.com/tendermint/tendermint
- github.com/tendermint/tm-db

- github.com/rs/zerolog
test:
files:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Removes sync-info code for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943).
* Clean up ReadFromClient [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Enhance the config get and changed commands to make it easier to find fields [#1968](https://github.com/provenance-io/provenance/pull/1968).
* Change the default keyring backend to "os", but leave it as "test" for testnets [#1968](https://github.com/provenance-io/provenance/pull/1968).
* Change the default broadcast mode to "sync" [#1968](https://github.com/provenance-io/provenance/pull/1968).
* The pre-upgrade command now updates the client config's broadcast mode to "sync" if it's set to "block" [#1968](https://github.com/provenance-io/provenance/pull/1968).
* Remove all `GetSigners()` methods [#1957](https://github.com/provenance-io/provenance/pull/1957).
* Ensure all `Msg`s have correctly identified `signer` fields [#1957](https://github.com/provenance-io/provenance/pull/1957).
* Clean up all the module codecs [#1957](https://github.com/provenance-io/provenance/pull/1957).
* Switch to auto-generated `String` and `Equal` methods for most proto messages [#1957](https://github.com/provenance-io/provenance/pull/1957).
* Clean up the marker module's expected BankKeeper interface [#1954](https://github.com/provenance-io/provenance/pull/1954).

### Deprecated

* In the config commands, the "tendermint" and "tm" options are deprecated, replaced with "cometbft", "comet", and "cmt" [#1968](https://github.com/provenance-io/provenance/pull/1968).

### Dependencies

- Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.1 ([#1910](https://github.com/provenance-io/provenance/pull/1910), [#1956](https://github.com/provenance-io/provenance/pull/1956))
Expand Down
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ not required to an open issue to submit a PR, but be aware that for more complex
problems/features, if a PR is opened before an adequate design discussion has
taken place in a github issue, that PR runs a high likelihood of being rejected.

Take a peek at our [coding repo](https://github.com/tendermint/coding) for
overall information on repository workflow and standards. Note, we use `make tools` for installing the linting tools.

Other notes:

- Looking for a good place to start contributing? How about checking out some
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif

BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2> /dev/null)
BRANCH_PRETTY := $(subst /,-,$(BRANCH))
TM_VERSION := $(shell $(GO) list -m github.com/tendermint/tendermint 2> /dev/null | sed 's:.* ::') # grab everything after the space in "github.com/tendermint/tendermint v0.34.7"
export CMTVERSION := $(shell $(GO) list -m github.com/cometbft/cometbft 2> /dev/null | sed 's:.* ::')
COMMIT := $(shell git log -1 --format='%h' 2> /dev/null)
# don't override user values
ifeq (,$(VERSION))
Expand Down Expand Up @@ -108,7 +108,7 @@ ldflags = -w -s \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(CMTVERSION)

ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Please report security vulnerabilities to
The Provenance team will send a response indicating the next steps in handling your
report. After the initial reply to your report, the team will keep you informed
of the progress towards remediation and may ask for additional
information or guidance.  For critical problems you may encrypt your report using the public key below.
information or guidance. For critical problems you may encrypt your report using the public key below.

In addition, please include the following information along with your report:

Expand All @@ -27,7 +27,7 @@ an email to **[security@provenance.io](mailto:security@provenance.io)**. The ema
a short description of why it should be handled according to this security
policy.

If you have found an issue with the Cosmos SDK or Tendermint modules not found in this repo you can report them through links found here. https://tendermint.com/security/
If you have found an issue with the Cosmos SDK or CometBFT modules not found in this repo you can report them through links found here: <https://github.com/cometbft/cometbft/blob/main/SECURITY.md>.

## Disclosure Policy

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig serverconfig.API
// Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register new tendermint queries routes from grpc-gateway.
// Register new queries routes from grpc-gateway.
cmtservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register node gRPC service for grpc-gateway.
Expand Down
3 changes: 1 addition & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ import (
"github.com/provenance-io/provenance/internal/pioconfig"
)

// DefaultConsensusParams defines the default Tendermint consensus params used in
// SimApp testing.
// DefaultConsensusParams defines the default consensus params used in SimApp testing.
var DefaultConsensusParams = &cmttmtypes.ConsensusParams{
Block: &cmttmtypes.BlockParams{
MaxBytes: 200000,
Expand Down
Loading

0 comments on commit ca0ec9c

Please sign in to comment.