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

Loader: add PipelineSpec test #44

Open
dilyand opened this issue Feb 19, 2020 · 2 comments
Open

Loader: add PipelineSpec test #44

dilyand opened this issue Feb 19, 2020 · 2 comments

Comments

@dilyand
Copy link
Contributor

dilyand commented Feb 19, 2020

No description provided.

@dilyand dilyand changed the title Add PipelineSpec test for Loader Loader: add PipelineSpec test Feb 20, 2020
@dilyand
Copy link
Contributor Author

dilyand commented Mar 6, 2020

This appears to be impossible. A PipelineSpec dry runs the entire job. It allows us to provide test inputs that go through the processing logic and populate a test output, on which assertions are performed. However, part of the Loader.run() logic is to load events into BQ and only failures make it all the way to the failedInserts output. The consequence of this is that whenever a PipelineSpec test is run, it tries to insert data in an actual BigQuery table.

There doesn't appear to be a way to provide a mock BQ table to the PipelineSpec test.

@dilyand
Copy link
Contributor Author

dilyand commented Mar 25, 2020

A solution to this seems to be a dedicated test table in BQ where we can load data when the test runs.

We will need:

  • a tf stack to deploy test infrastructure (prefixed with gcp_test_* pattern to distinguish from the other stacks)
  • each test writes a small number of rows
  • a regular job (sql runner?) to reset the table.

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

No branches or pull requests

1 participant