bazel-skylib icon indicating copy to clipboard operation
bazel-skylib copied to clipboard

Create a failure test rule

Open FaBrand opened this issue 3 years ago • 7 comments

When testing for analysis-phase-failures in rules this rule provides otherwise necessary boilerplate that simply allows to test for correct Error messages

I discovered this reoccuring rule while testing some of my rules and thougt it might be useful to others as well.

FaBrand avatar May 27 '21 09:05 FaBrand

@brandjon @tetromino Do you have any feedback on this?

FaBrand avatar Jun 01 '21 09:06 FaBrand

Bump :)

FaBrand avatar Sep 24 '21 15:09 FaBrand

@tetromino Thanks for the detailed feedback :) I updated the change with your findings and also added the stardoc target for the new rule and generated the docs. However i'm not sure if i have much leverage (or maybe missed something) on generating good documentation there. e.g. the target_under_test or the rule docs attribute can't be set through the analysistest.make and stardoc generates empty defaults. The module docstring does not seem to be included as well.

FaBrand avatar Sep 28 '21 13:09 FaBrand

Sorry for very delayed review; I'm on leave. But as for the generated docs problem, I realized that we were using a very old Stardoc release via the (deprecated) Federation repo. We'll fix that by https://github.com/bazelbuild/bazel-skylib/pull/327

tetromino avatar Oct 21 '21 15:10 tetromino

@tetromino Sry for the even later reaction :/

I fixed the docs and squashed to commits for a cleaner history

FaBrand avatar Mar 16 '22 16:03 FaBrand

Kind of forgot this PR 🙈 I updated everything to the latest version. Could you please update your review @tetromino ? Or is ownership handled differently now @brandjon @comius @hvadehra @c-mita ?

FaBrand avatar Oct 27 '22 08:10 FaBrand

ping @brandjon @comius @c-mita

FaBrand avatar Apr 26 '23 08:04 FaBrand