Skip to content

fix(tests): Re-enable Metrics integration test by renaming #118

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 9 commits into from
Nov 16, 2020

Conversation

ttomsu
Copy link

@ttomsu ttomsu commented Nov 11, 2020

Looks like metrics wasn't working this whole time because this test never got picked up. Whoops...

@ttomsu ttomsu requested a review from a team November 11, 2020 21:02
Copy link
Member

@meltsufin meltsufin left a comment

Choose a reason for hiding this comment

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

I thought we were using the *IntegrationTests pattern for integration tests. Do we just need to list metrics as part of the matrix?

@ttomsu
Copy link
Author

ttomsu commented Nov 11, 2020

We are - which is why this test results wasn't firing. I was getting a permission denied error in the old repo w GHA and investigated why I wasn't getting it in the new repo.

The 'metrics' module is already included in the big list of parallelized integration tests.


=== Stackdriver Metrics Explicitly Enabled

If you're importing the `spring-cloud-gcp-starter-metrics` module, the Stackdriver metrics now need to be explicitly enabled with the property `management.metrics.export.stackdriver.enabled=true`
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm. Ideally, our starter would provide all the necessary dependencies, so the end user does not need to specify an extra property. Would that be possible?

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The fault should be enabled, but it looks like something is setting management.metrics.export.defaults.enabled=false. Looking more into it.

Copy link
Member

Choose a reason for hiding this comment

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

It's done here: spring-projects/spring-boot@b1830da#diff-196296cded479f093a123da98914f159381d3eef89c33f20148075a58085b34fR53

Basically, Spring Boot Test automatically disabled metrics export, unless you add the @AutoConfigureMetrics annotation.

I'll update this branch with that.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's ignored in tests, so we need to move the property from main/resources to test/resources, and no need to document for end users.

@ttomsu ttomsu requested a review from elefeint November 12, 2020 15:18
@ttomsu
Copy link
Author

ttomsu commented Nov 13, 2020

Tests are back to green now.

@@ -28,6 +28,10 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Copy link
Member

@meltsufin meltsufin Nov 13, 2020

Choose a reason for hiding this comment

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

@ttomsu When running from IntelliJ, removing it didn't break the sample for me, but now I see that it's actually required. In fact, I think it needs to be moved into our spring-cloud-gcp-starter-metrics.

@meltsufin
Copy link
Member

I moved all changes unrelated to re-enabling the test to a separate PR. See: #121

@ttomsu ttomsu dismissed stale reviews from meltsufin and elefeint November 16, 2020 13:48

Collaborated on change.

@ttomsu ttomsu merged commit d730d56 into master Nov 16, 2020
@ttomsu ttomsu deleted the metrics-fix branch November 16, 2020 13:50
kateryna216 added a commit to kateryna216/spring-cloud-gcp that referenced this pull request Oct 20, 2022
…udPlatform#118)

* fix(tests): Re-enable Metrics integration test by renaming
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants