chore(samples): Major update according review comments.#369
chore(samples): Major update according review comments.#369kweinmeister merged 23 commits intogoogleapis:mainfrom
Conversation
|
Warning: This pull request is touching the following templated files:
|
| String bucketName = System.getenv("BUCKET_NAME"); | ||
| String gcsBucket = String.format("gs://%s", System.getenv("BUCKET_NAME")); | ||
| String gcsErrorBucket = String.format("%s/errors", gcsBucket); | ||
| String defaultCatalog = String.format( |
| // TODO(developer): Replace these variables before running the sample. | ||
| String projectId = ServiceOptions.getDefaultProjectId(); | ||
| String bucketName = System.getenv("BUCKET_NAME"); | ||
| String defaultCatalog = |
| public static void main(String[] args) throws IOException, InterruptedException { | ||
| // TODO(developer): Replace these variables before running the sample. | ||
| String projectId = ServiceOptions.getDefaultProjectId(); | ||
| String defaultCatalog = |
| } | ||
| } catch (BigQueryException e) { | ||
| System.out.printf("Dataset '%s' was not deleted.%n%s", datasetName, e); | ||
| System.out.printf("%nDataset '%s' was not deleted.%n%s", datasetName, e); |
| // TO CHECK ERROR HANDLING USE THE JSON WITH INVALID USER EVENT: gcsEventsObject = | ||
| // "user_events_some_invalid.json" | ||
|
|
||
| CreateTestResources.main(); |
There was a problem hiding this comment.
I'm not sure if this would work though:
- It will be expensive and slow to recreate everything for each single test.
- If a parallel RemoveTestReourcesTest is running in between this line and the next line, there's still a chance that the tests will fail.
So unless we can prevent RemoveTestReourcesTest from being run, we got a chance for test failures. I'm thinking if it's OK for us to just simply ignore/remove CreateTestReourcesTest and RemoveTestReourcesTest as it may affect other tests, and this is just for an one-time set up only, not being used in future code samples.
There was a problem hiding this comment.
As an option, we can remove these 2 tests.
If it acceptable for coverage percentage, let's do it.
There was a problem hiding this comment.
@Neenu1995 The create and remove samples are one-time utility scripts to recreate the test assets. I agree that we don't need to run these every time, and that's not the intent of these - we want to have persistent assets in our repo.
Can these tests be removed / or annotated to ignore running? Also, will this cause any issues with code coverage?
There was a problem hiding this comment.
If you plan to have persistent assets, then I believe the CreateTestReourcesTest and RemoveTestReourcesTest is never used again. In that case, it is better to remove the code entirely.
But if you see a use case where this code may be used again, it is fine to keep it with an ignored annotation.
There was a problem hiding this comment.
Thanks all! Given that CreateTestReourcesTest and RemoveTestReourcesTest is removed, this line can be removed now.
| String tableId = "events"; | ||
| // TO CHECK ERROR HANDLING USE THE TABLE OF INVALID USER EVENTS: tableId = "events_some_invalid" | ||
|
|
||
| CreateTestResources.main(); |
| // TO CHECK ERROR HANDLING USE THE JSON WITH INVALID USER EVENT: gcsEventsObject = | ||
| // "user_events_some_invalid.json" | ||
|
|
||
| CreateTestResources.main(); |
There was a problem hiding this comment.
Thanks all! Given that CreateTestReourcesTest and RemoveTestReourcesTest is removed, this line can be removed now.
| // TRY THE FULL RECONCILIATION MODE HERE: | ||
| ReconciliationMode reconciliationMode = ReconciliationMode.INCREMENTAL; | ||
|
|
||
| CreateTestResources.main(); |
| // TO CHECK ERROR HANDLING USE THE JSON WITH INVALID PRODUCT | ||
| // GCS_PRODUCTS_OBJECT = "products_some_invalid.json" | ||
|
|
||
| CreateTestResources.main(); |
|
Merge-on-green attempted to merge your PR for 6 hours, but it was not mergeable because either one of your required status checks failed, one of your required reviews was not approved, or there is a do not merge label. Learn more about your required status checks here: https://help.github.com/en/github/administering-a-repository/enabling-required-status-checks. You can remove and reapply the label to re-run the bot. |
Changes in all classes:
Fixes #367