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

#[pg_test] does not respect #[ignore] or other test attributes #599

Closed
2 tasks done
workingjubilee opened this issue Jun 21, 2022 · 2 comments
Closed
2 tasks done

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Jun 21, 2022

The #[ignore] attribute is not the most common to use in Rust test suites but it is still part of the way the language handles testing and is very convenient when e.g. developing a system that shouldn't have all validation tests applied to it yet, or when some tests should only sometimes be run. ( This can be preferable to diffing over a thousand-line test to "comment it out". )

Currently, annotating something with both #[pg_test] and #[ignore] most test-related attributes, because it generates a new test with a different name, means that new test is built and run by the PGX framework without attention to the proper results.
Ideally, PGX would respect the annotation.

EDIT: There's more than one attribute it should respect, actually.

  • #[ignore]
  • #[should_panic]
@workingjubilee workingjubilee changed the title #[pg_test] does not respect #[ignore] #[pg_test] does not respect #[ignore] or other test attributes Jun 21, 2022
@BradyBonnette
Copy link
Contributor

@workingjubilee this issue can probably be closed as I merged in #613

@workingjubilee
Copy link
Member Author

Yep! I just used #[should_panic] in a PL/Rust test last night and it worked like a charm.

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

No branches or pull requests

2 participants