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

test: add tests for governance modifiable params #2973

Closed

Conversation

fahimahmedx
Copy link
Contributor

@fahimahmedx fahimahmedx commented Dec 31, 2023

Overview

The second PRs that addresses #2916. This PR adds test cases for the governance modifiable params.

Checklist

  • New and updated code has appropriate documentation
  • New and updated code has new and/or updated testing
  • Required CI checks are passing
  • Visual proof for any user facing features like CLI or documentation updates
  • Linked issues closed with keywords

evan-forbes pushed a commit that referenced this pull request Jan 2, 2024
…#2974)

## Overview
Addresses #2966 by using the governance modifiable params tests in PR
#2973.
All four of the params are modifiable by governance, which matches the
specs in
[params.md](https://github.com/celestiaorg/celestia-app/blob/main/specs/src/specs/params.md).

## Checklist
- [x] New and updated code has appropriate documentation
- [x] New and updated code has new and/or updated testing
- [x] Required CI checks are passing
- [x] Visual proof for any user facing features like CLI or
documentation updates
- [ ] Linked issues closed with keywords
@fahimahmedx fahimahmedx marked this pull request as ready for review January 2, 2024 22:06
Copy link
Contributor

coderabbitai bot commented Jan 2, 2024

Walkthrough

Walkthrough

The recent updates involve a refinement in the blockchain parameters, particularly for the Celestia application. The DataCommitmentWindow parameter now requires a minimum value of 100. Additionally, a comprehensive test suite has been added to ensure the smooth modifiability of various parameters across different modules, including authentication and governance, thereby enhancing the blockchain's adaptability and robustness.

Changes

File Path Change Summary
specs/src/specs/params.md Updated DataCommitmentWindow parameter to have a minimum of 100.
x/paramfilter/test/governance_params_test.go Added test suite for modifiability of parameters in Celestia app.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat with CodeRabbit Bot (@coderabbitai)

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your comments unless it is explicitly tagged.

  • You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging @coderabbitai in a comment. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • You can tag @coderabbitai in a PR comment and ask questions about the PR and the codebase. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid.
    • @coderabbitai read the files in the src/scheduler package and generate README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! This mostly LGTM.

x/paramfilter/test/governance_params_test.go Outdated Show resolved Hide resolved
suite.Run(t, new(TestSuite))
}

func (suite *TestSuite) TestModifiableParameters() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] do we want another test for TestUnmodifiableParameters()?

Copy link
Contributor Author

@fahimahmedx fahimahmedx Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm currently doing that in PR #2919. I think the code is more organized & readable if we do have separate function tests for modifiable and unmodifiable params. Would love to get your input on this!

Copy link
Collaborator

@rootulp rootulp Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea two separate tests works for me. IMO we shouldn't merge #2919 until we get rough alignment via the CIP process so I think it could make sense to port the TestUnmodifiableParameters() test here.

  1. One PR for increasing test coverage.
  2. If we deem it necessary, a separate PR for implementation changes. This second PR will be more confidence-inspiring if we also have to update tests and move some params from TestModifiableParameters to TestUnmodifiableParameters

@celestia-bot celestia-bot requested a review from a team January 4, 2024 06:06
@rootulp
Copy link
Collaborator

rootulp commented Jan 4, 2024

@fahimahmedx can you port the TestUnmodifiableParameters here? Ideally all params are covered via these tests. Then we can close #2916 when this merges.

@rootulp
Copy link
Collaborator

rootulp commented Jan 18, 2024

Closing in favor of #3007. Thanks for all your work on this!

@rootulp rootulp closed this Jan 18, 2024
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.

3 participants