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

Cannot regenerate golden files for executor_test.go from scratch #183

Closed
nekketsuuu opened this issue Jul 29, 2022 · 1 comment · Fixed by #192
Closed

Cannot regenerate golden files for executor_test.go from scratch #183

nekketsuuu opened this issue Jul 29, 2022 · 1 comment · Fixed by #192

Comments

@nekketsuuu
Copy link
Contributor

nekketsuuu commented Jul 29, 2022

This is a bug-like issue on development of this plugin.

What happened:

I want to regenerate *.golden.txt files under pkg/timestream/testdata in order to send a pull request. So I prepared grafanaDB.DevOps table on my own AWS account using "sample database" feature (described below), and commented out the following line, and run TestGenerateTestData.

// This will do real API calls to AWS to populate test data
t.Skip("Integration Test") // comment line to run this

But the run is failed with messages, for example, execute failed ValidationException: line 5:8: Column 'availability_zone' does not exist. This is because some queries want certain column names which my records in grafanaDB.DevOps don't have.

RawQuery: `select measure_name, availability_zone, region, cell, silo, instance_type, instance_name, create_time_series(time, measure_value::double)

So... it seems these test cases for pkg/timestream/executor_test.go assume some private records in grafanaDB.DevOps table. I may guess what columns are needed and add them to my table, but it's a bit tired to me.

Therefore, could someone add a timestream-write script to set up a table for executor_test.go to this repository and write a how-to-test document? Or, would someone simplify test cases to use names only in the sample database?

What you expected to happen:

I can regenerate test data easily.

How to reproduce it (as minimally and precisely as possible):

  1. Create a sample database of Amazon Timestream with following configs:
    • region: us-west-2
    • database name: grafanaDB
    • sample table: DevOps with single-measure records
  2. Comment out t.Skip("Integration Test") in executor_test.go.
  3. Run test case TestGenerateTestData.

Screenshot of Management Console to create the database:

A screenshot of a web page which displays configs described above

Environment:

  • Plugin version: v2.1.0 (0832f25)
  • User OS: macOS
  • Go: go1.18.4 darwin/amd64
@sarahzinger
Copy link
Member

Hello! Thanks for reporting this issue! I took a look at this as part of triaging new tickets, and also ran into issues trying to run this "TestGenerateTestData" function. I haven't looked deeply enough to identify what's going on, but I think at the very least the suggestion here for a help doc seems warranted. Going to move this to our backlog as it seems worth investigating although I'm not sure on a specific timeline for a fix yet. Will bring it up with the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants