fix: enable skipped tests for notification rules and fixup issue in tag matcher

pull/16379/head
Johnny Steenbergen 2020-01-01 17:01:10 -08:00 committed by Johnny Steenbergen
parent acf73dfdd4
commit 77dd06bc5e
5 changed files with 19 additions and 5 deletions

View File

@ -38,6 +38,7 @@
1. [16268](https://github.com/influxdata/influxdb/pull/16268): Fixed test flakiness that stemmed from multiple flush/signins being called in the same test suite
1. [16346](https://github.com/influxdata/influxdb/pull/16346): Update pkger task export to only trim out option task and not all vars provided
1. [16374](https://github.com/influxdata/influxdb/pull/16374): Update influx CLI, only show "see help" message, instead of the whole usage.
1. [16380](https://github.com/influxdata/influxdb/pull/16380): Fix notification tag matching rules and enable tests to verify
### UI Improvements

View File

@ -435,9 +435,7 @@ func (s *Service) forEachNotificationRule(ctx context.Context, tx Tx, descending
return nil
}
func filterNotificationRulesFn(
idMap map[influxdb.ID]bool,
filter influxdb.NotificationRuleFilter) func(nr influxdb.NotificationRule) bool {
func filterNotificationRulesFn(idMap map[influxdb.ID]bool, filter influxdb.NotificationRuleFilter) func(nr influxdb.NotificationRule) bool {
if filter.OrgID != nil {
return func(nr influxdb.NotificationRule) bool {
if !nr.MatchesTags(filter.Tags) {

View File

@ -11,7 +11,6 @@ import (
)
func TestBoltNotificationRuleStore(t *testing.T) {
t.Skip("https://github.com/influxdata/influxdb/issues/14799")
influxdbtesting.NotificationRuleStore(initBoltNotificationRuleStore, t)
}

View File

@ -337,7 +337,9 @@ func (b *Base) ClearPrivateData() {
// MatchesTags returns true if the Rule matches all of the tags
func (b *Base) MatchesTags(tags []influxdb.Tag) bool {
if len(tags) == 0 {
return true
}
// for each tag in NR
// if there exists
// a key value match with operator == equal in tags

View File

@ -475,6 +475,20 @@ func TestMatchingRules(t *testing.T) {
},
exp: true,
},
{
name: "Non empty tag rule matches empty filter tags",
tagRules: []notification.TagRule{
{
Tag: influxdb.Tag{
Key: "c",
Value: "d",
},
Operator: influxdb.NotEqual,
},
},
filterTags: []influxdb.Tag{},
exp: true,
},
{
name: "Empty tag rule matches empty filter tags",
tagRules: []notification.TagRule{},