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

Deprecating global seeding, updating tests #4

Open
wants to merge 5 commits into
base: awsgov2
Choose a base branch
from

Conversation

fredjoonpark
Copy link

The deprecation of how seeds used to be set (rand.seed(1337)) required some updates to the core code for general compatibility with other modules.

Created a ticket for updating the InfluxDB module with this new approach including updating the tests.

@trevorbonas
Copy link

Running go test ./... in cmd shows these failures:

$ go test ./...
?   	github.com/timescale/tsbs/cmd/tsbs_generate_data	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/akumuli	[no test files]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/cassandra [build failed]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/clickhouse [build failed]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/cratedb [build failed]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/influx [build failed]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/mongo	[no test files]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/questdb [build failed]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/siridb [build failed]
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timescaledb [build failed]
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timestream	0.386s
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/victoriametrics [build failed]
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/common	0.210s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/devops	0.483s
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/iot	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/utils	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_akumuli	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_cassandra	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_clickhouse	[no test files]
ok  	github.com/timescale/tsbs/cmd/tsbs_load_cratedb	0.470s
ok  	github.com/timescale/tsbs/cmd/tsbs_load_influx	2.628s
?   	github.com/timescale/tsbs/cmd/tsbs_load_mongo	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus/adapter	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus/adapter/noop	[no test files]
ok  	github.com/timescale/tsbs/cmd/tsbs_load_questdb	0.823s
ok  	github.com/timescale/tsbs/cmd/tsbs_load_siridb	0.961s
?   	github.com/timescale/tsbs/cmd/tsbs_load_timescaledb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_victoriametrics	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_akumuli	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_cassandra	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_clickhouse	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_cratedb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_influx	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_mongo	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_questdb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_siridb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_timescaledb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_timestream	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_victoriametrics	[no test files]
FAIL

Results prefixed with ? can be ignored.

For the failures, using influx as an example, I get the following:

$ cd cmd/tsbs_generate_queries/databases/influx && go clean -testcache && go test -v                                                             
# github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/influx [github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/influx.test]
./devops_test.go:41:51: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:80:51: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:124:51: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:153:31: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:183:31: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:295:31: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:362:49: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./devops_test.go:416:33: not enough arguments in call to b.NewDevops
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./iot_test.go:92:47: not enough arguments in call to b.NewIoT
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./iot_test.go:122:47: not enough arguments in call to b.NewIoT
	have (time.Time, time.Time, number)
	want (time.Time, time.Time, int, int64)
./iot_test.go:122:47: too many errors
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/influx [build failed]

@fredjoonpark
Copy link
Author

fredjoonpark commented Mar 6, 2025

@trevorbonas For the first set of logs, the main set of tests I focused on was for timestream. Maybe we can look into updating the rest of the tests for the other modules, but I'm not sure how useful that would be.

As for the second logs, I created a separate ticket to update the influxdb tests and logic for supporting seed, as this PR was already getting pretty big.

@trevorbonas
Copy link

trevorbonas commented Mar 6, 2025

@trevorbonas For the first set of logs, the main set of tests I focused on was for timestream. Maybe we can look into updating the rest of the tests for the other modules, but I'm not sure how useful that would be.

As for the second logs, I created a separate ticket to update the influxdb tests and logic for supporting seed, as this PR was already getting pretty big.

The rest of the other tests should be updated. Your changes broke them. Interestingly, running tests on master shows test failures in influx and timestream. Note that apart from these, all other database tests pass:

$ go test ./...
?   	github.com/timescale/tsbs/cmd/tsbs_generate_data	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/akumuli	[no test files]
# github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timestream [github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timestream.test]
tsbs_generate_queries/databases/timestream/devops_test.go:74:15: d.getMeasureNameWhereString undefined (type *Devops has no field or method getMeasureNameWhereString)
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/cassandra	0.225s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/clickhouse	0.422s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/cratedb	0.726s
--- FAIL: TestDevopsGetHostWhereString (0.00s)
    --- FAIL: TestDevopsGetHostWhereString/single_host (0.00s)
        devops_test.go:87: incorrect output:
            got
            (hostname = 'host_8')
            want
            (hostname = 'host_1')
    --- FAIL: TestDevopsGetHostWhereString/multi_host_(2) (0.00s)
        devops_test.go:87: incorrect output:
            got
            (hostname = 'host_0' or hostname = 'host_1')
            want
            (hostname = 'host_7' or hostname = 'host_9')
    --- FAIL: TestDevopsGetHostWhereString/multi_host_(3) (0.00s)
        devops_test.go:87: incorrect output:
            got
            (hostname = 'host_4' or hostname = 'host_2' or hostname = 'host_3')
            want
            (hostname = 'host_1' or hostname = 'host_8' or hostname = 'host_5')
FAIL
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/influx	0.544s
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/mongo	[no test files]
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/questdb	0.794s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/siridb	0.604s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timescaledb	0.769s
FAIL	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/timestream [build failed]
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/databases/victoriametrics	0.936s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/common	1.094s
ok  	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/devops	1.177s
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/iot	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_generate_queries/utils	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_akumuli	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_cassandra	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_clickhouse	[no test files]
ok  	github.com/timescale/tsbs/cmd/tsbs_load_cratedb	0.666s
ok  	github.com/timescale/tsbs/cmd/tsbs_load_influx	3.088s
?   	github.com/timescale/tsbs/cmd/tsbs_load_mongo	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus/adapter	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_prometheus/adapter/noop	[no test files]
ok  	github.com/timescale/tsbs/cmd/tsbs_load_questdb	0.818s
ok  	github.com/timescale/tsbs/cmd/tsbs_load_siridb	0.767s
?   	github.com/timescale/tsbs/cmd/tsbs_load_timescaledb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_load_victoriametrics	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_akumuli	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_cassandra	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_clickhouse	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_cratedb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_influx	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_mongo	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_questdb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_siridb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_timescaledb	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_timestream	[no test files]
?   	github.com/timescale/tsbs/cmd/tsbs_run_queries_victoriametrics	[no test files]
FAIL

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.

2 participants