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

Tests #67

Closed
wants to merge 4 commits into from
Closed

Tests #67

wants to merge 4 commits into from

Conversation

jaybuidl
Copy link
Member

@jaybuidl jaybuidl commented Apr 5, 2022

Summary by CodeRabbit

  • New Features

    • Introduced new configuration files for ESLint and Prettier to enhance code quality and formatting.
    • Added comprehensive test suites for KlerosCore, DisputeKitClassic, and ModeratedEvidenceModule smart contracts to ensure robust functionality.
    • Implemented utility functions for testing, including event validation and timestamp manipulation.
  • Bug Fixes

    • Updated various dependency versions to improve compatibility and performance.
  • Chores

    • Removed outdated test files to streamline the testing framework.
    • Adjusted TypeScript configuration for better project structure and compilation management.

@jaybuidl jaybuidl modified the milestones: prealpha-2, prealpha-3 May 23, 2022
@codeclimate
Copy link

codeclimate bot commented May 23, 2022

Code Climate has analyzed commit 9715f74 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 1, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 15 Code Smells

No Coverage information No Coverage information
2.2% 2.2% Duplication

Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces significant changes to the project configuration and testing setup. Key modifications include updates to the ESLint configuration to disable certain rules and the addition of a Prettier configuration file. Several test suites for smart contracts are added, focusing on functionalities like dispute resolution and evidence handling. Additionally, new utility functions and constants are introduced for testing purposes, while some files are deleted to streamline the testing framework.

Changes

File Path Change Summary
contracts/.eslintrc.js ESLint rules modified: "node/no-unsupported-features/es-syntax" commented out, new rules added and turned off.
contracts/.prettierrc New file created with settings for endOfLine and printWidth.
contracts/hardhat.config.ts Removed import for task, changed path property formatting in docgen.
contracts/package.json Updated @nomiclabs/hardhat-ethers version, removed ethereum-waffle.
contracts/test/arbitration/core.spec.ts New test suite for KlerosCore contract covering initialization, governance, and dispute management.
contracts/test/arbitration/dispute-kit-classic.spec.ts New test suite for DisputeKitClassic contract with tests for dispute creation and governance.
contracts/test/arbitration/dispute-kit-sybil.spec.ts Added "TODO" comment, no functional changes.
contracts/test/arbitration/index.ts Deleted file containing tests for DisputeKitClassic.
contracts/test/chai-setup.ts Modified import statements for chai module for consistency.
contracts/test/cross-chain/fast-bridge.spec.ts Added "TODO" comment, no functional changes.
contracts/test/cross-chain/simple-bridge.spec.ts Added "TODO" comment, no functional changes.
contracts/test/evidence.spec.ts New test suite for ModeratedEvidenceModule and CentralizedArbitrator covering evidence submission and moderation.
contracts/test/evidence/index.ts Deleted file containing tests for "Home Evidence" contract.
contracts/test/pre-alpha1/index.ts Deleted file containing tests for Kleros arbitration protocol.
contracts/test/rng.spec.ts New test suite for ConstantNG and IncrementalNG number generators.
contracts/test/shared/arbitration.ts New file with functions for creating and managing subcourts.
contracts/test/shared/constants.ts New constants added for testing Ethereum and PNK representations.
contracts/test/shared/enums/arbitrator.ts New enum DisputeStatus added.
contracts/test/shared/enums/core.ts New enum Period added.
contracts/test/shared/enums/evidence.ts New enum Party added with roles in evidence process.
contracts/test/shared/index.ts New utility functions for testing Ethereum smart contracts introduced.
contracts/tsconfig.json Updated include and exclude properties in compilerOptions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Contract
    participant TestSuite

    User->>TestSuite: Initiate tests
    TestSuite->>Contract: Deploy contracts
    Contract-->>TestSuite: Contracts deployed
    TestSuite->>Contract: Run tests
    Contract-->>TestSuite: Return results
    TestSuite-->>User: Display test results
Loading

Possibly related PRs

Suggested labels

Package: Web

Suggested reviewers

  • alcercu
  • kemuru

Poem

🐇 In the code where bunnies play,
New tests hop in to save the day!
With rules adjusted, neat and clear,
Our contracts dance, no need to fear.
So let us cheer, for changes bright,
In the land of code, all feels just right! 🌟


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants