-
Notifications
You must be signed in to change notification settings - Fork 517
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
fix: cargo test run also run doctest #5563
Conversation
Signed-off-by: yihong0618 <[email protected]>
Hi, I don't think it's good to skip doc test. I prefer to fix the contributing guide instead. |
yes but this doctest I think its better to ignore here, cause for developers the most simple and intuitions do is and for now for opendal I do not see any directly doctest in the repo and actions. and for the the way run all the unit tests is
and issue can track #4187 |
Yep, that's why I think updating guide is a better idea. It would also be beneficial to migrate all doc tests to memory services, allowing us to avoid dependence on the
Hi, I didn't understand this. Nearly all of OpenDAL's public API includes a corresponding doc test as an example. For example: opendal/core/src/types/operator/operator.rs Lines 62 to 75 in c4da050
We should not encourage developers to run I understand that it might be frustrating that you can't run all unit tests locally. However, this is due to the complexities we encounter within OpenDAL (and the service it support). We strongly encourage you to simply submit PRs and let the CI perform the checks, addressing any issues only if the CI fails. |
the other part is fine and I understand it, and the design the better way is not ignore it but find a way to make |
The root cause here is that we can't ignore doc tests that require specific features to be enabled. Maybe we can go in the other direction: try migrating all doc tests away from relying on the |
that make sense, will try to do it |
|
seems also need s3, will try and fix it |
after check this is not better either, old test doc is good, and s3 example is better for users, the better way is open these features when doctest |
We can skip the only s3 test if needed. |
this is a better way will follow this https://users.rust-lang.org/t/doctests-that-require-a-non-default-feature-is-it-possible/29529 |
this works if you agree will change all the doc tests do not in default features in this way |
Sorry, I don't think this aligns with what we want. This adds a significant maintenance burden for developers. The preferred way will be:
|
ok as you wish |
after thinking about either way for me is not good, I think keep the old code is better so closing this |
Which issue does this PR close?
No issue
Closes #.
Rationale for this change
Do not run doctest for
cargo test
What changes are included in this PR?
before: will raise a lot of doc tests error
after: everything works fine
Are there any user-facing changes?
no
no