Skip to content

Conversation

@disq
Copy link
Member

@disq disq commented Feb 17, 2023

So that each cqtype can be used as source for destination testing/development.

@disq disq requested review from a team and yevgenypats February 17, 2023 13:50
dataAsMap := make(map[string]any)
for i, c := range table.Columns {
if data[i].GetStatus() == schema.Present {
dataAsMap[c.Name] = data[i].String()
Copy link
Member Author

@disq disq Feb 17, 2023

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.

@github-actions
Copy link

This PR has the following changes to source plugin(s) tables:

  • Table test_testdata_table was added

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
Copy link
Member Author

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{}
Copy link
Member Author

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.

@erezrokah erezrokah added the automerge Automatically merge once required checks pass label Feb 19, 2023
@kodiakhq kodiakhq bot merged commit 9a997fe into cloudquery:main Feb 19, 2023
@disq disq deleted the feat/test_add_testdata branch February 19, 2023 10:07
erezrokah added a commit that referenced this pull request Feb 19, 2023
<!-- 🎉 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 ✅
--->
kodiakhq bot pushed a commit that referenced this pull request Feb 21, 2023
🤖 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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Automatically merge once required checks pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants