build(flux): update flux to v0.156.0 (#23142)
* build(flux): update flux to v0.156.0 * chore(flux/schema): update schema tests to assert planner rules The schema test where updated in Flux, this updates them here so that we can assert that the planner rules are applied. See note about copied data. Co-authored-by: Nathaniel Cook <nvcook42@gmail.com>pull/23149/head
parent
c4717ef469
commit
afb9733072
|
@ -38,7 +38,11 @@ DB_TESTS="${DB_INTEGRATION_WRITE_TESTS},${DB_INTEGRATION_READ_TESTS}"
|
|||
|
||||
run_integration_tests() {
|
||||
log "Running integration tests..."
|
||||
./fluxtest -v -p flux.zip -p query/ --skip "${DB_TESTS}",group_one_tag_first,group_all_filter_field_first,group_one_tag_filter_field_first,group_one_tag_last,group_all_filter_field_last,group_one_tag_filter_field_last,integration_hdb_injection,integration_pg_injection,integration_mysql_injection,integration_mariadb_injection,integration_mssql_injection
|
||||
./fluxtest \
|
||||
-v \
|
||||
-p flux.zip \
|
||||
-p query/ \
|
||||
--skip "${DB_TESTS}",group_one_tag_first,group_all_filter_field_first,group_one_tag_filter_field_first,group_one_tag_last,group_all_filter_field_last,group_one_tag_filter_field_last,integration_hdb_injection,integration_pg_injection,integration_mysql_injection,integration_mariadb_injection,integration_mssql_injection
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
|
|
2
go.mod
2
go.mod
|
@ -34,7 +34,7 @@ require (
|
|||
github.com/hashicorp/vault/api v1.0.2
|
||||
github.com/imdario/mergo v0.3.9 // indirect
|
||||
github.com/influxdata/cron v0.0.0-20201006132531-4bb0a200dcbe
|
||||
github.com/influxdata/flux v0.154.0
|
||||
github.com/influxdata/flux v0.156.0
|
||||
github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69
|
||||
github.com/influxdata/influxql v1.1.1-0.20211004132434-7e7d61973256
|
||||
github.com/influxdata/line-protocol v0.0.0-20200327222509-2487e7298839
|
||||
|
|
4
go.sum
4
go.sum
|
@ -416,8 +416,8 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH
|
|||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
github.com/influxdata/cron v0.0.0-20201006132531-4bb0a200dcbe h1:7j4SdN/BvQwN6WoUq7mv0kg5U9NhnFBxPGMafYRKym0=
|
||||
github.com/influxdata/cron v0.0.0-20201006132531-4bb0a200dcbe/go.mod h1:XabtPPW2qsCg0tl+kjaPU+cFS+CjQXEXbT1VJvHT4og=
|
||||
github.com/influxdata/flux v0.154.0 h1:VkU5osapLl37NR8yfngW7wZ+Ln7VbGRec+kjMaW1Qhs=
|
||||
github.com/influxdata/flux v0.154.0/go.mod h1:qjuLZJvOoMUBcubg+qNrc0pLbG55iRCVNokwq/8q7is=
|
||||
github.com/influxdata/flux v0.156.0 h1:CWpozf6MbPRU8SSpalsalc56uaRjowbtom0IkiRFwAs=
|
||||
github.com/influxdata/flux v0.156.0/go.mod h1:qjuLZJvOoMUBcubg+qNrc0pLbG55iRCVNokwq/8q7is=
|
||||
github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69 h1:WQsmW0fXO4ZE/lFGIE84G6rIV5SJN3P3sjIXAP1a8eU=
|
||||
github.com/influxdata/httprouter v1.3.1-0.20191122104820-ee83e2772f69/go.mod h1:pwymjR6SrP3gD3pRj9RJwdl1j5s3doEEV8gS4X9qSzA=
|
||||
github.com/influxdata/influx-cli/v2 v2.2.1-0.20211129214229-4c0fae3a4c0d h1:An2Su6JpQwYTmONvndYkkjxtfAE5w04rUyH1kf/tWcg=
|
||||
|
|
|
@ -0,0 +1,525 @@
|
|||
package influxdb_test
|
||||
|
||||
|
||||
import "testing/expect"
|
||||
import "internal/debug"
|
||||
import "array"
|
||||
import "testing"
|
||||
import "csv"
|
||||
import "influxdata/influxdb/schema"
|
||||
|
||||
// TODO(nathanielc): The test data below is duplicated from the Flux test code.
|
||||
// This is because we can't use options in tests that extend other tests.
|
||||
// This makes it so that the tests pass and do the same thing, but any changes
|
||||
// to the source data in Flux will need to be reflected here.
|
||||
// Range of the input data
|
||||
start = 2018-05-22T19:53:16Z
|
||||
stop = 2018-05-22T19:53:26Z
|
||||
|
||||
// cpu:
|
||||
// tags: host,cpu
|
||||
// fields: usage_idle,usage_user
|
||||
cpu =
|
||||
array.from(
|
||||
rows: [
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.83,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.72,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.97,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.local",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_idle",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_idle",
|
||||
_value: 1.92,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu0",
|
||||
_field: "usage_user",
|
||||
_value: 1.95,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "cpu",
|
||||
host: "host.global",
|
||||
cpu: "cpu1",
|
||||
_field: "usage_user",
|
||||
_value: 1.92,
|
||||
},
|
||||
],
|
||||
)
|
||||
|> group(columns: ["_measurement", "_field", "host", "cpu"])
|
||||
|
||||
// swap:
|
||||
// tags: host,partition
|
||||
// fields: used_percent
|
||||
swap =
|
||||
array.from(
|
||||
rows: [
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 66.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 66.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 37.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.local",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 37.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 72.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:16Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 72.98,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sda1",
|
||||
_field: "used_percent",
|
||||
_value: 88.59,
|
||||
},
|
||||
{
|
||||
_time: 2018-05-22T19:53:26Z,
|
||||
_measurement: "swap",
|
||||
host: "host.global",
|
||||
partition: "/dev/sdb1",
|
||||
_field: "used_percent",
|
||||
_value: 88.59,
|
||||
},
|
||||
],
|
||||
)
|
||||
|> group(columns: ["_measurement", "_field", "host", "partition"])
|
||||
|
||||
option schema._from = (bucket) =>
|
||||
union(
|
||||
tables: [
|
||||
cpu
|
||||
|> debug.opaque(),
|
||||
swap
|
||||
|> debug.opaque(),
|
||||
],
|
||||
)
|
||||
|> testing.load()
|
||||
|
||||
testcase push_down_tagValues extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.tagValues()
|
||||
}
|
||||
testcase push_down_measurementTagValues extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurementTagValues()
|
||||
}
|
||||
testcase push_down_tagKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagKeysRule": 1])
|
||||
schema_test.tagKeys()
|
||||
}
|
||||
testcase push_down_measurementTagKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagKeysRule": 1])
|
||||
schema_test.measurementTagKeys()
|
||||
}
|
||||
testcase push_down_fieldKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.fieldKeys()
|
||||
}
|
||||
testcase push_down_measurementFieldKeys extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurementFieldKeys()
|
||||
}
|
||||
testcase push_down_measurements extends "flux/influxdata/influxdb/schema/schema_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
schema_test.measurements()
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package influxdb_test
|
||||
|
||||
|
||||
import "testing/expect"
|
||||
|
||||
testcase push_down_show_fields_with_meas_pred extends "flux/influxdata/influxdb/schema/show_fields_with_meas_pred_test" {
|
||||
expect.planner(rules: ["PushDownReadTagValuesRule": 1])
|
||||
show_fields_with_meas_pred_test.show_fields_with_meas_pred()
|
||||
}
|
Loading…
Reference in New Issue