Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(simapp): read file config and then flags #17833

Closed
wants to merge 1 commit into from

Conversation

facundomedica
Copy link
Member

Description

Closes: #17822

I don't know how to test this, sadly. Ideas appreciated


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • run make lint and make test
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@facundomedica facundomedica requested a review from a team as a code owner September 21, 2023 14:08
@github-prbot github-prbot requested review from a team, alexanderbez and tac0turtle and removed request for a team September 21, 2023 14:08
@github-actions

This comment was marked as spam.

@julienrbrt julienrbrt changed the title fix: read file config and then flags fix(simapp): read file config and then flags Sep 21, 2023
@odeke-em
Copy link
Collaborator

odeke-em commented Sep 21, 2023

@facundomedica we can do the following in the unit test

  • Grab the original value of the DefaultNodeHome
  • Set a directory inside testing.T.TempDir()
  • Create a new directory then write the files in there
func TestReadConfigThenFlags(t *testing.T) {
    origDefaultNodeHome := simapp.DefaultNodeHome
    defer func() {
        simapp.DefaultNodeHome = origDefaultNodeHome
    }()

    // 1. Generate the new node home
    newNodeHome := filepath.Join(t.TempDir(), "simapp")
    simapp.DefaultNodeHome = newNodeHome
    // 2. Write a config in there
    configFile := filepath.Join(newNodeHome, "config.json")
    if err := os.WriteFile(configFile, configJSON, 0644); err != nil {
         t.Fatal(err)
    }

@julienrbrt julienrbrt marked this pull request as draft September 21, 2023 17:17
@julienrbrt julienrbrt self-assigned this Sep 25, 2023
@julienrbrt
Copy link
Member

julienrbrt commented Sep 28, 2023

Taking this over in #17920.
Cannot reproduce flags issues, but we're discussing on Slack about it.

@julienrbrt julienrbrt closed this Sep 28, 2023
@julienrbrt julienrbrt deleted the facu/no-flag-overwrite branch September 28, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Sign mode textual error if not upper case
3 participants