Skip to content

Add delete_in_advance test for a missing destination table - #121

Merged
chikamura merged 1 commit into
feature/mockwebserver-e2e-testsfrom
test/delete-in-advance-missing-table
Sep 25, 2026
Merged

chikamura merged 1 commit into
feature/mockwebserver-e2e-testsfrom
test/delete-in-advance-missing-table

Conversation

@john-abre

Copy link
Copy Markdown

Summary

Follow-up to #110. Adds one end-to-end test, testRunDeleteInAdvanceModeWhenDestinationTableDoesNotExist, covering the first run of mode: delete_in_advance against a fresh dataset, where the destination table does not exist yet.

Every mock response in the current suite is either a success or a 500. This is the first 404 case. It pins down that:

  • autoCreate()'s tables.delete receives a 404
  • the client library maps that to BigQuery#delete() returning false rather than throwing
  • the plugin ignores the return value, so the run proceeds exactly as when the delete succeeds: temp table create, load, copy with WRITE_TRUNCATE, temp table delete, final getTable

The test is a copy of testRunDeleteInAdvanceMode with the second enqueued response swapped for errorResponse(404, ..., "notFound"). All request-sequence assertions are identical to the success case, which is the point.

Test plan

  • ./gradlew spotlessApply test --tests TestBigqueryJavaOutputPluginWithMockServer passes (9 tests, including the new one)

🤖 Generated with Claude Code

First run against a fresh dataset: the destination table doesn't exist,
so autoCreate()'s tables.delete gets a 404. The client library maps that
to BigQuery#delete() returning false, and the plugin ignores the return
value, so the run proceeds exactly as when the delete succeeds. Pin that
down with a mock-server run that returns 404 on the initial delete.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@chikamura chikamura left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you. LGTM.

@chikamura
chikamura merged commit 3875153 into feature/mockwebserver-e2e-tests Sep 25, 2026
@chikamura
chikamura deleted the test/delete-in-advance-missing-table branch September 25, 2026 03:31
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

Successfully merging this pull request may close these issues.

2 participants