Skip to content

opt: directive that asserts a rule was used#29135

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
justinj:expect-directive
Aug 28, 2018
Merged

opt: directive that asserts a rule was used#29135
craig[bot] merged 1 commit intocockroachdb:masterfrom
justinj:expect-directive

Conversation

@justinj
Copy link
Copy Markdown
Contributor

@justinj justinj commented Aug 27, 2018

Brought up in #29050 as a possibility to avoid the case of certain rules
no longer applying.

Kind of a strawman right now because I'm not sure

  • if this is the syntax we want,
  • how widely we want to use it, I've just added it to one file for the
    purposes of this PR.

I think this is probably valuable in that it asserts we're testing what
we want to test, but I do think it's a little invasive as far as
cluttering up the test directives goes. Open to suggestions for how to
possibly improve.

Release note: None

@justinj justinj requested a review from a team as a code owner August 27, 2018 18:26
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opttester already has a ruleFromString

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/sql/opt/testutils/opt_tester.go, line 96 at r1 (raw file):

	// DisableRules is a set of rules that are not allowed to run.
	DisableRules map[opt.RuleName]struct{}

Should also be a RuleSet

Copy link
Copy Markdown
Contributor Author

@justinj justinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh great - didn't notice that.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/sql/opt/testutils/opt_tester.go, line 96 at r1 (raw file):

Previously, RaduBerinde wrote…

Should also be a RuleSet

Done.

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Note that all flags are documented in the comment for RunCommand, please update it.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained

Copy link
Copy Markdown
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: I think you can go ahead and add this in other places where we are testing rules - seems useful!

Reviewed 1 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

Copy link
Copy Markdown
Contributor

@andy-kimball andy-kimball left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:, will be interesting to see what issues this turns up

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale)

@justinj
Copy link
Copy Markdown
Contributor Author

justinj commented Aug 28, 2018

TFTRs! Was going to put the additional directive changes on this PR but after some thought I'm going to split it out and merge this as-is.

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Build failed (retrying...)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Build failed (retrying...)

@mberhault
Copy link
Copy Markdown
Contributor

Bors will never pass this, Lint is failing. I recommend waiting for GitHub CI to pass before asking bors to merge.

@justinj
Copy link
Copy Markdown
Contributor Author

justinj commented Aug 28, 2018

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Canceled

Brought up in cockroachdb#29050 as a possibility to avoid the case of certain rules
no longer applying.

I think this is probably valuable in that it asserts we're testing what
we want to test, but I do think it's a little invasive as far as
cluttering up the test directives goes. Open to suggestions for how to
possibly improve.

Release note: None
@justinj
Copy link
Copy Markdown
Contributor Author

justinj commented Aug 28, 2018

CI green now

bors r+

@andreimatei
Copy link
Copy Markdown
Contributor

still "wip"?

@justinj justinj changed the title opt[wip]: directive that asserts a rule was used opt: directive that asserts a rule was used Aug 28, 2018
@justinj
Copy link
Copy Markdown
Contributor Author

justinj commented Aug 28, 2018

renamed the PR - the commit message was updated before

@andreimatei
Copy link
Copy Markdown
Contributor

andreimatei commented Aug 28, 2018 via email

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request Aug 28, 2018
29135: opt: directive that asserts a rule was used r=justinj a=justinj

Brought up in #29050 as a possibility to avoid the case of certain rules
no longer applying.

Kind of a strawman right now because I'm not sure
* if this is the syntax we want,
* how widely we want to use it, I've just added it to one file for the
  purposes of this PR.

I think this is probably valuable in that it asserts we're testing what
we want to test, but I do think it's a little invasive as far as
cluttering up the test directives goes. Open to suggestions for how to
possibly improve.

Release note: None

29219: kv: truncate RangeFeed span to range descriptor  r=nvanbenschoten a=nvanbenschoten

Small fix for RangeFeed's interaction with DistSender.

Co-authored-by: Justin Jaffray <justin@cockroachlabs.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Aug 28, 2018

Build succeeded

@craig craig bot merged commit 5870878 into cockroachdb:master Aug 28, 2018
@RaduBerinde
Copy link
Copy Markdown
Member

backport? could be useful for debugging

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

Successfully merging this pull request may close these issues.

7 participants