Skip to content

fix(js/plugins/google-cloud): Run all tests and refactor to only initialize telemetry once #3076

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 1 commit into from
Jun 16, 2025

Conversation

bryanatkinson
Copy link
Contributor

There was an 'it.only' in one of the tests. Removing it uncovered that the two describe blocks couldn't actually both run successfully because they were each enabling telemetry when this can only happen once. I rearranged the tests to make sure that we only initialize telemetry once, but this uncovered another problem, where only one of them was enabling JSON format for the logs, so I updated everything to use structured JSON format.

Checklist (if applicable):

There was an 'it.only' in one of the tests. Removing it uncovered that the two describe blocks couldn't actually both run successfully because they were each enabling telemetry when this can only happen once.  I rearranged the tests to make sure that we only initialize telemetry once, but this uncovered another problem, where only one of them was enabling JSON format for the logs, so I updated everything to use structured JSON format.
@bryanatkinson bryanatkinson requested a review from schnecle June 13, 2025 21:04
@bryanatkinson bryanatkinson changed the title fix(google-cloud): Run all tests and refactor to only initialize telemetry once fix(js/plugins/google-cloud): Run all tests and refactor to only initialize telemetry once Jun 16, 2025
Copy link
Contributor

@schnecle schnecle left a comment

Choose a reason for hiding this comment

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

Ah yeah, this is part of a refactor that I started a while ago to move away from the raw text log lines we output when we don't specify a json formatter to look at the actual json object. I think that' why we had the it.only because you don't really need those other ones. They aren't hurting anything but they are less comprehensive. This looks good!

@bryanatkinson bryanatkinson merged commit 74c6c81 into main Jun 16, 2025
5 checks passed
@bryanatkinson bryanatkinson deleted the ba-fix-logs-tests branch June 16, 2025 19:59
hendrixmar pushed a commit that referenced this pull request Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants