Skip to content

docs: update dev docs for running tests - #3157

Merged
kariy merged 2 commits into
dojoengine:mainfrom
cwkang1998:docs/update-dev-docs
Apr 11, 2025
Merged

docs: update dev docs for running tests#3157
kariy merged 2 commits into
dojoengine:mainfrom
cwkang1998:docs/update-dev-docs

Conversation

@cwkang1998

@cwkang1998 cwkang1998 commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Description

Mainly updating the DEVELOPMENT.md document to include more details on running the tests initially. Based on what I faced during development.

Related issue

N/A

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed
  • DEVELOPMENT.md

Checklist

  • I've formatted my code (scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

Summary by CodeRabbit

  • Documentation
    • Updated setup instructions to improve the clarity of Rust installation and updating.
    • Refined guidance on preparing test artifacts and running the test suite with an enhanced test runner.
    • Added note regarding the use of nextest as the test runner, with a link for more information.

@coderabbitai

coderabbitai Bot commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Ohayo, sensei! This update refines the instructions in the DEVELOPMENT.md file. The installation step has been reworded from "Install Rust and run the test suite to confirm your setup:" to "Install & update Rust:". Additionally, the documentation now specifies that users should generate database artifacts via bash scripts/rebuild_test_artifacts.sh before running tests with cargo test. A note has also been added to indicate that nextest is being used as the test runner. There were no changes to any exported or public entity declarations.

Changes

File Change Summary
DEVELOPMENT.md - Changed installation step text to "Install & update Rust:"
- Added instructions to generate database artifacts using bash scripts/rebuild_test_artifacts.sh
- Updated test execution instructions with cargo test
- Noted usage of nextest as the test runner

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant ArtifactGenerator as Artifact Script
    participant TestRunner as Nextest

    User->>ArtifactGenerator: Run 'bash scripts/rebuild_test_artifacts.sh'
    ArtifactGenerator-->>User: Database artifacts generated
    User->>TestRunner: Run 'cargo test'
    TestRunner-->>User: Returns test results
Loading

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 3b9aeeb and 0265eaa.

⛔ Files ignored due to path filters (2)
  • spawn-and-move-db.tar.gz is excluded by !**/*.gz
  • types-test-db.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (1)
  • DEVELOPMENT.md (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • DEVELOPMENT.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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 anywhere in the PR title to generate the title automatically.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
DEVELOPMENT.md (3)

21-22: Ohayo, sensei – Clarify the Rust update step.
The new instruction “Install & update Rust:” now runs rustup override set stable && rustup update && cargo test in one go. This may lead to tests running before the required database artifacts are generated in later steps. Please consider clarifying whether running tests here is intentional or if the test step should be separated until after the artifacts are ready.


27-35: Ohayo, sensei – Review the test execution sequence.
The updated section instructs users to first generate DB artifacts (bash scripts/rebuild_test_artifacts.sh) and then run tests (cargo test), which is a great enhancement. However, note that the previous Rust update step also runs cargo test. This might cause duplicated test execution or confusion about the intended order of operations. Please consider consolidating these commands or adding a note to explain the rationale behind running tests in two separate blocks.


51-52: Ohayo, sensei – Nice nextest note addition.
The update clearly states that nextest is used as the test runner and provides a helpful link. For even better guidance, you might consider adding a brief note or a link for installation/setup instructions for nextest, just in case some developers are not yet familiar with it.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 186c83e and 2e7a037.

⛔ Files ignored due to path filters (6)
  • crates/dojo/core-cairo-test/Scarb.lock is excluded by !**/*.lock
  • crates/torii/types-test/Scarb.lock is excluded by !**/*.lock
  • examples/simple/Scarb.lock is excluded by !**/*.lock
  • examples/spawn-and-move/Scarb.lock is excluded by !**/*.lock
  • spawn-and-move-db.tar.gz is excluded by !**/*.gz
  • types-test-db.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (1)
  • DEVELOPMENT.md (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

@cwkang1998
cwkang1998 force-pushed the docs/update-dev-docs branch from 2e7a037 to 3b9aeeb Compare April 11, 2025 09:56
@codecov

codecov Bot commented Apr 11, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.61%. Comparing base (186c83e) to head (2b9543a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3157   +/-   ##
=======================================
  Coverage   55.60%   55.61%           
=======================================
  Files         443      443           
  Lines       62962    62962           
=======================================
+ Hits        35012    35017    +5     
+ Misses      27950    27945    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cwkang1998
cwkang1998 force-pushed the docs/update-dev-docs branch from 3b9aeeb to 6f169c9 Compare April 11, 2025 10:25
@cwkang1998
cwkang1998 force-pushed the docs/update-dev-docs branch from 6f169c9 to 0265eaa Compare April 11, 2025 10:26

@kariy kariy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @cwkang1998, can you restore back the tar files ?

Comment thread spawn-and-move-db.tar.gz
Comment thread types-test-db.tar.gz

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

restore this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, should the db tar and also the changes to the scarb lock files during test runs be generally ignored and reverted for other contributions too?

Is there any reason these test related files are tracked in version control?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Iirc we don't really have a strong reason to actually track these files other than to make the CI run faster and have a slightly more controlled environment. Considering the changes that might break the test files happen only so frequently (eg changes on Cairo version or core Cairo lib).

Unless I'm wrong on this CC @glihm .

@cwkang1998
cwkang1998 requested a review from kariy April 11, 2025 17:09
Comment thread DEVELOPMENT.md
Comment on lines +30 to +31
# First generate db artifacts for the tests
bash scripts/rebuild_test_artifacts.sh

@kariy kariy Apr 11, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ah this should actually just be:

Suggested change
# First generate db artifacts for the tests
bash scripts/rebuild_test_artifacts.sh
# First generate db artifacts for the tests
bash scripts/extract_test_db.sh

because we already tracked the compressed db files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah

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.

2 participants