cargo-hack icon indicating copy to clipboard operation
cargo-hack copied to clipboard

Implement --randomize-powerset feature

Open vi opened this issue 11 months ago • 7 comments

Resolves #265.

vi avatar Jan 03 '25 05:01 vi

Thanks for the PR! I'm positive on adding this feature. However:

  • CI is failing, so please fix that.
    • It should be able to be fixed by running cargo fmt and adding the words listed here to .github/.cspell/project-dictionary.txt.
  • Usually, I tend to choose fastrand over rand as a library for randomization unless rand is necessary for security reasons.
    • As for rand, I have experienced several maintenance pains with it in the past. (For example, the ones mentioned in https://github.com/rust-lang/futures-rs/pull/2641#issuecomment-1243975665.)
    • It does not necessarily need to be done as part of this PR.
      • However, I think I need to address that before I release this feature, so if you can address that in this PR, I can publish a new release right after I merge this PR.

taiki-e avatar Jan 25 '25 07:01 taiki-e

Is it a good idea to also add (in this PR) a pagination options (like --powerset-start-from=3000 --powerset-num-tests=1000) for splitting big scans over multiple invocations?

vi avatar Jan 25 '25 08:01 vi

As for the addition of other options, it would be easier to review if they were separated into separate PRs.

taiki-e avatar Jan 25 '25 10:01 taiki-e

As for the addition of other options, it would be easier to review if they were separated into separate PRs.

Implemented as a continuation PR: https://github.com/vi/cargo-hack/pull/1

Note that for some reason it includes empty feature set case in each run.

vi avatar Jan 25 '25 19:01 vi

Any updates on this? can I help somehow? This will help me a lot, currently I have ~80 jobs, where only ~15 of them have meaningful tests, I partition them, but the biggest tests all fall on the same partition :(

elichai avatar Jun 04 '25 14:06 elichai

@elichai As discussed in https://github.com/vi/cargo-hack/pull/1, what is needed here is for someone to take over https://github.com/taiki-e/cargo-hack/pull/255 and complete it.

taiki-e avatar Jun 04 '25 14:06 taiki-e

@elichai As discussed in vi#1, what is needed here is for someone to take over #255 and complete it.

Thank you! Commented there to understand better what's missing. (if you don't have the capacity and/or my comments are not helpful feel free to ignore me :) )

elichai avatar Jun 04 '25 15:06 elichai