Skip to content

chore: Make it practical to make simultaneous compliance test runs. #166

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

Merged
merged 169 commits into from
May 13, 2021

Conversation

jimfulton
Copy link
Contributor

@jimfulton jimfulton commented May 12, 2021

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #165 🦕

This changes SQLAlchemy-provided compliance tests to run in temporary datasets, so multiple test runs can happen simultaneously.

Unfortunately, this requires disabling the tests that verify that you can refer to tables with dataset/schema names mydataset.mytable be disabled by default, as the schema used by these tests is hard-coded. These tests can still be run manually using --requirements pybigquery.requirements:WithSchemas. The system tests exercise this functionality.

BTW, the system tests need the same treatment. That will be in a separate PR.

Jim Fulton added 30 commits April 12, 2021 08:39
The source of the dependency bug is in old versions of google-cloud-core that
depend on too-old versions of google-api-core.
Some tests are still failing, but
we're far enough along that we have the right shape, I think.
The moral equivalent of    "where foo in (@bar)", where bar is an array
which actually need to be  "where foo in unnest (@bar)".
Other fixes:
- Handle BIGINT
- Fix string leteral formatting (and start type-specific adaptations).
The SQLAlchemy like convenience functions (e.g. ) escape incorrectly for
BigQuery, so re-escape.
We could make that work, if we want to. :)
…ry keys, etc., that BigQuery doesn't have.
The source of the dependency bug is in old versions of google-cloud-core that
depend on too-old versions of google-api-core.
So we don't have t mock at the api level.
- Run tests in temporary directory rather than sharing memory connections.
  Because simpler. :)
- Introduce cross-connection state and record queries in it, so tests can
  make assertions bout generated queries.
…laceholder

The BigQuery Python Client supports an extended placeholder syntax
that includes type information, as in `%(foo:INT64)s` (named) or
`%(:INT64)s` (unnamed).

When we know the type, include it in the placeholder.
The numeric tests now tun since we started passing type info from sqla to bigquery.

The CTE tests test features that don't exist in bigquery.
Although the test isn't actually testing dialect code.  Maybe it
should be skipped instead.

Also set the profile test pasth to a more reasonable value, although
it doesn't seem to be used. <shrug>
Also inlined colspecs code, because there wasn't much and it
facilitated separating literal processing into a function.
Jim Fulton added 7 commits May 11, 2021 16:27
It didn't buy us anything.
Because:

- It duplicated the `--dropfirst` option.

- Unlike `--dropfirst`, it didn't honor the `--dburi` option that lets you use an alternate URL/dataset.
The schema-tests schema is hard coded, and cleaning it and running it's tests could conflict with other test runs.
Also, use multiple simple --only-rerun options rather than one complex one.
@jimfulton jimfulton requested a review from a team as a code owner May 12, 2021 17:15
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. label May 12, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label May 12, 2021
@jimfulton jimfulton added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels May 12, 2021
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels May 12, 2021
@jimfulton jimfulton closed this May 12, 2021
@jimfulton jimfulton reopened this May 12, 2021
@jimfulton jimfulton closed this May 12, 2021
@jimfulton jimfulton reopened this May 12, 2021
@jimfulton jimfulton closed this May 12, 2021
@jimfulton jimfulton reopened this May 12, 2021
@jimfulton jimfulton changed the title chore: Make it easier to make simultaneous test runs. chore: Make it practical to make simultaneous compliance test runs. May 13, 2021
Copy link

@plamut plamut left a comment

Choose a reason for hiding this comment

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

LGTM

@jimfulton jimfulton merged commit ab5df16 into master May 13, 2021
@jimfulton jimfulton deleted the riversnake-tests branch May 13, 2021 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery-sqlalchemy API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple compliance test runs
4 participants