FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(test): Add testdata table by disq · Pull Request #8175 · cloudquery/cloudquery · GitHub

feat(test): Add testdata table - #8175

Merged
kodiakhq[bot] merged 3 commits into
cloudquery:mainfrom
disq:feat/test_add_testdata
Feb 19, 2023
Merged

feat(test): Add testdata table#8175
kodiakhq[bot] merged 3 commits into
cloudquery:mainfrom
disq:feat/test_add_testdata

Conversation

disq commented Feb 17, 2023

Copy link
Copy Markdown
Member

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

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()

disq Feb 17, 2023
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

data[i].Get() fails with array types (no data is inserted), but .String() seems to work for all.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This resets any primary key/not null definitions.

erezrokah added the automerge Automatically merge once required checks pass label Feb 19, 2023
kodiakhq Bot merged commit 9a997fe into cloudquery:main Feb 19, 2023
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL