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

Add integration tests for Elasticsearch meter registry #1434

Merged
merged 9 commits into from
Feb 6, 2020

Conversation

izeye
Copy link
Contributor

@izeye izeye commented May 23, 2019

This PR adds integration tests on Elasticsearch meter registry for Elasticsearch 5 and 6. We can add one for Elasticsearch 7 once #1428 has been merged.

Closes gh-1429

@izeye
Copy link
Contributor Author

izeye commented May 25, 2019

requestMappingIsInstrumented - io.micrometer.spring.autoconfigure.MetricsAutoConfigurationIntegrationTest continues to fail in CircleCI as follows:

io.micrometer.core.instrument.search.MeterNotFoundException: Unable to find a meter that matches all the requirements at once. Here's what was found:
   FAIL: No meter with name 'http.server.requests' was found.
   OK: Meters with type timer were found.
	at io.micrometer.core.instrument.search.MeterNotFoundException$FromRequiredSearch.build(MeterNotFoundException.java:228)
	at io.micrometer.core.instrument.search.MeterNotFoundException$FromRequiredSearch.access$100(MeterNotFoundException.java:46)
	at io.micrometer.core.instrument.search.MeterNotFoundException.forSearch(MeterNotFoundException.java:43)
	at io.micrometer.core.instrument.search.RequiredSearch.findOne(RequiredSearch.java:199)
	at io.micrometer.core.instrument.search.RequiredSearch.timer(RequiredSearch.java:122)
	at io.micrometer.spring.autoconfigure.MetricsAutoConfigurationIntegrationTest.requestMappingIsInstrumented(MetricsAutoConfigurationIntegrationTest.java:91)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:252)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:94)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
	at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Iterator.forEachRemaining(Iterator.java:116)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
	at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)

It didn't happen in my local builds and looking at the commit (0e4343b) which the test started to fail in this branch, it doesn't seem to be relevant to this change. It might be related to some dependency update via dynamic versioning.

.circleci/config.yml Outdated Show resolved Hide resolved
@izeye
Copy link
Contributor Author

izeye commented May 28, 2019

I rebased this onto the current master (which includes #1428), squashed into one commit, and force-pushed. Along the way, I added a test for Elasticsearch 7. I confirmed it's been built successfully with ./gradlew clean check locally but it might fail in the CircleCI in the same way as above.

@shakuzen shakuzen added the registry: elastic An ElasticSearch Registry related issue label Jun 17, 2019
@izeye
Copy link
Contributor Author

izeye commented Dec 5, 2019

I would definitely like the integration tests to run in the CI, though I guess if we can run them locally at least, that is better than now where we have no integration tests. Until we can figure out a more complete solution.

@shakuzen I rebased this onto master, and removed the blocking executorType change for now, so the integration tests will be skipped in CircleCI, but they will be run locally.

@izeye izeye force-pushed the gh-1429 branch 3 times, most recently from bad783d to 4ffea53 Compare December 5, 2019 22:56
@shakuzen
Copy link
Member

shakuzen commented Dec 9, 2019

I'm pretty sure I found the way to get Docker stuff working in CircleCI when I set CI things up for https://github.com/micrometer-metrics/prometheus-rsocket-proxy/. I meant to come back and apply it here so we could get this merged and tested. That said, I've also been considering switching the CI to GitHub Actions, but that probably wouldn't happen before the 1.4 release which I'm hoping to get out by the end of the year. I'll try to take a look at this more once I get some other work for 1.4 done first.

@bsideup
Copy link

bsideup commented Dec 9, 2019

FTR the easiest way to get Docker on CircleCI is to use the machine executor:

    machine:
      enabled: true

See Testcontainers' own CircleCI config:
https://github.com/testcontainers/testcontainers-java/blob/1.12.4/.circleci/config.yml

@izeye
Copy link
Contributor Author

izeye commented Dec 23, 2019

@bsideup @shakuzen seems to be looking for another approach to avoid build time increase.

See #1434 (comment)

@izeye
Copy link
Contributor Author

izeye commented Feb 3, 2020

@shakuzen I rebased onto the master to include #1837 and tagged Docker-based tests.

@codefromthecrypt
Copy link

haven't looked at the code, but the docker ci ran the docker tests and I verified the other didn't

  * /home/circleci/micrometer/test-results/junit/TEST-io.micrometer.elastic.ElasticsearchMeterRegistryElasticsearch5IntegrationTest.xml
  * /home/circleci/micrometer/test-results/junit/TEST-io.micrometer.elastic.ElasticsearchMeterRegistryElasticsearch6IntegrationTest.xml
  * /home/circleci/micrometer/test-results/junit/TEST-io.micrometer.elastic.ElasticsearchMeterRegistryElasticsearch7IntegrationTest.xml

Copy link

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

bumping versions as better now than a surprise break tomorrow

izeye and others added 3 commits February 4, 2020 21:34
Co-Authored-By: Adrian Cole <adriancole@users.noreply.github.com>
Co-Authored-By: Adrian Cole <adriancole@users.noreply.github.com>
Co-Authored-By: Adrian Cole <adriancole@users.noreply.github.com>
@izeye
Copy link
Contributor Author

izeye commented Feb 4, 2020

@adriancole Thanks for the feedback! I applied your suggested changes.

Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Looks good. Just a couple comments.

izeye and others added 3 commits February 6, 2020 21:47
Co-Authored-By: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
@izeye
Copy link
Contributor Author

izeye commented Feb 6, 2020

@shakuzen Thanks for the feedback! I applied your suggested changes.

@shakuzen shakuzen merged commit 0fcd8ee into micrometer-metrics:master Feb 6, 2020
@izeye izeye deleted the gh-1429 branch February 6, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
registry: elastic An ElasticSearch Registry related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration test against supported Elasticsearch versions
5 participants