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

feat(macros): ✨ New require and logging macros #32

Merged
merged 2 commits into from
Jan 12, 2024

Conversation

Trantorian1
Copy link
Member

👍 New Features:

  • #[logging] macro: adds logging capabilities to unit tests, allowing to use the log crate without any setup.

ex:

#[tokio::test]
#[logging]
async fn test() {
    log::info!("Hello test!");
}
  • #[require(block_min = u64, block_max = u64)]: allows to specify block bounds for running rpc tests on the node specified in secret.json. This will be done at compile time by making a call for the latest block and comparing it to the given bounds. If the last block available to the deoxys node is not in theses bounds, test will be ignored an will not be run until next compilation.

ex:

#[require(block_min = 50000)]
#[tokio::test]
async fn test() {
    // ...
}

⚠️ Note that secret.json has been moved to project root

Trantorian added 2 commits January 11, 2024 18:26
Logging provides log capabilities in tests via the `log` crate while `require` allows to specify RPC node requirements to run unit tests
@antiyro antiyro merged commit 272a25b into KasarLabs:main Jan 12, 2024
1 check passed
@Trantorian1 Trantorian1 deleted the feat/macros branch January 12, 2024 11:03
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