-
Notifications
You must be signed in to change notification settings - Fork 544
feat(test): Add testdata table #8175
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
Conversation
| dataAsMap := make(map[string]any) | ||
| for i, c := range table.Columns { | ||
| if data[i].GetStatus() == schema.Present { | ||
| dataAsMap[c.Name] = data[i].String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data[i].Get() fails with array types (no data is inserted), but .String() seems to work for all.
This PR has the following changes to source plugin(s) tables:
|
| table := testdata.TestSourceTable("test_testdata_table") | ||
| for i, c := range table.Columns { | ||
| if strings.HasPrefix(c.Name, "_cq_") { | ||
| table.Columns[i].Name = "test" + c.Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce complexity, rather than removing the _cq_id and _cq_parent_id columns here I just add 'test' to the names.
| if strings.HasPrefix(c.Name, "_cq_") { | ||
| table.Columns[i].Name = "test" + c.Name | ||
| } | ||
| table.Columns[i].CreationOptions = schema.ColumnCreationOptions{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resets any primary key/not null definitions.
<!-- 🎉 Thank you for making CloudQuery awesome by submitting a PR 🎉 --> #### Summary The script logic started failing with #8175. The easiest solution is to skip the test plugin as it doesn't follow other plugins conventions <!-- Use the following steps to ensure your PR is ready to be reviewed - [ ] Read the [contribution guidelines](../blob/main/CONTRIBUTING.md) 🧑🎓 - [ ] Test locally on your own infrastructure - [ ] Run `go fmt` to format your code 🖊 - [ ] Lint your changes via `golangci-lint run` 🚨 (install golangci-lint [here](https://golangci-lint.run/usage/install/#local-installation)) - [ ] Update or add tests 🧪 - [ ] Ensure the status checks below are successful ✅ --->
🤖 I have created a release *beep* *boop* --- ## [1.4.0](plugins-source-test-v1.3.34...plugins-source-test-v1.4.0) (2023-02-21) ### Features * **test:** Add testdata table ([#8175](#8175)) ([9a997fe](9a997fe)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.38.2 ([#8156](#8156)) ([ac2d2d7](ac2d2d7)) * **deps:** Update module golang.org/x/net to v0.7.0 [SECURITY] ([#8176](#8176)) ([fc4cef8](fc4cef8)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
So that each cqtype can be used as source for destination testing/development.