GithubHelp home page GithubHelp logo

nextest-rs / datatest-stable Goto Github PK

View Code? Open in Web Editor NEW
35.0 2.0 6.0 183 KB

Data-driven tests on stable Rust

Home Page: https://docs.rs/datatest-stable

License: Other

Rust 93.86% Awk 1.71% Shell 4.43%
data-driven-tests datatest rust testing nextest

datatest-stable's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

datatest-stable's Issues

No coverage information generated

I'm not sure if this is just some kind of user error, but I can't see to get coverage information generated for my datatests.

Coverage information is being generated, but it only seems to contain the hits from the non-datatest tests. When I clear the '*.profraw' files and run just the datatest tests, there is 0% coverage.

Initially I tried running cargo llvm-cov --html, then I tried following the steps for external tests but that didn't work either.

What might make my use-case a bit unusual is the fact that the datatest tests are in their own crate in the workspace, and I'm expecting coverage information to be generated for another crate in the workspace.
I thought this structure could be part of the problem, so I tried replacing the datatest_stable::harness! macro with a main function that directly calls a function from the other crate, and then coverage information was successfully generated.

Any help on this issue would be greatly appreciated.

Fix quadratic performance with nextest

Let's say you have 10k files. Datatest-stable iterates over all files currently to build the list of tests. Since nextest has a process-per-test model, each test will iterate over every file. That's not great.

Instead, if --exact is passed in, we should be able to pinpoint the exact test and just use that.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

Renovate tried to run on this repository, but found these problems.

  • WARN: Error updating branch: update failure

Errored

These updates encountered an error and will be retried. Click on a checkbox below to force a retry now.

  • chore(deps): pin dependencies (cloudflare/pages-action, taiki-e/install-action)

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • camino 1.1.7
  • fancy-regex 0.13.0
  • libtest-mimic 0.7.3
  • walkdir 2.5.0
  • camino-tempfile 1.1.1
  • fs_extra 1.3.0
github-actions
.github/workflows/ci.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain stable
  • Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
  • taiki-e/install-action v2@36d793de2e01530e47054966bebba5d4ef6e9b9e
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain stable
  • Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain master
  • Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
  • taiki-e/install-action nextest
.github/workflows/coverage.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain nightly
  • Swatinem/rust-cache v2@23bce251a8cd2ffc3c1075eaa2367cf899916d84
  • taiki-e/install-action nextest
  • taiki-e/install-action cargo-llvm-cov
  • codecov/codecov-action v4@84508663e988701840491b86de86b666e8a86bed
.github/workflows/docs.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain stable
  • cloudflare/pages-action 1
.github/workflows/release.yml
  • actions/checkout v4@692973e3d937129bcbf40652eb9f2f61becf3332
  • dtolnay/rust-toolchain stable
  • taiki-e/install-action v2@36d793de2e01530e47054966bebba5d4ef6e9b9e
  • taiki-e/create-gh-release-action v1@72d65cee1f8033ef0c8b5d79eaf0c45c7c578ce3

The :path designator is too restrictive in the $name parameter

Hi,

I have been using this harness with Great Success (tm), apart from a minor inconvenience.

Background:

To reduce boilerplate with tests separated into modules, I made the following wrapper:

macro_rules! generate_harness{
    ($($test:ident),*) => {
        datatest_stable::harness!(
            $(
                $test::run_test,
                $test::test_dir(),
                $test::FILE_PATTERN,
            )*
        );
    }
}

generate_harness!(test_pdf_parser, test_structure_parser, test_reference_parsing);

Problem

Unfortunately if I modify the wrapper to use paths:

macro_rules! generate_harness{
    ($($test:path),*) => {
        datatest_stable::harness!(
            $(
                $test::run_test,
                $test::test_dir(),
                $test::FILE_PATTERN,
            )*
        );
    }
}

generate_harness!(pdf::test_pdf_parser, structure::test_structure_parser, grammar::test_reference_parsing);

Cause

It suddenly doesn't work, because rustc cannot properly comprehend $test::run_test if $test a path and not an ident.

This is due to rust-lang/rust#48067.

Solution?

Apparently, one possible workaround is using $Va : ident $( :: $Vb : ident )* instead of path, but I have not tested this.

Loosening $name to expr would also solve the problem I think.

I'd also be happy with any other idea. What I currently do is just import everything into the crate namespace, but that's going to be problematic sooner or later.

How about supporting, skip, only

Sometimes
developers want to skip some tests files for run and even want to place such test files in codebase skipping tests for them entirely.
or want to just run only one test file to save time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.