-
Notifications
You must be signed in to change notification settings - Fork 1k
Convert couchbase tests to java #12193
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
Changes from all commits
5f20b88
2eabc17
912bc50
7410c08
48d2f31
11b5985
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0; | ||
|
|
||
| import com.couchbase.client.java.cluster.BucketSettings; | ||
| import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | ||
| import io.opentelemetry.instrumentation.couchbase.AbstractCouchbaseAsyncClientTest; | ||
|
|
||
| class CouchbaseAsyncClientTest extends AbstractCouchbaseAsyncClientTest { | ||
|
|
||
| @Override | ||
| protected DefaultCouchbaseEnvironment.Builder envBuilder( | ||
| BucketSettings bucketSettings, int carrierDirectPort, int httpDirectPort) { | ||
| return CouchbaseUtil.envBuilder(bucketSettings, carrierDirectPort, httpDirectPort); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0; | ||
|
|
||
| import com.couchbase.client.java.cluster.BucketSettings; | ||
| import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | ||
| import io.opentelemetry.instrumentation.couchbase.AbstractCouchbaseClientTest; | ||
|
|
||
| class CouchbaseClientTest extends AbstractCouchbaseClientTest { | ||
|
|
||
| @Override | ||
| protected DefaultCouchbaseEnvironment.Builder envBuilder( | ||
| BucketSettings bucketSettings, int carrierDirectPort, int httpDirectPort) { | ||
| return CouchbaseUtil.envBuilder(bucketSettings, carrierDirectPort, httpDirectPort); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0; | ||
|
|
||
| import com.couchbase.client.core.metrics.DefaultLatencyMetricsCollectorConfig; | ||
| import com.couchbase.client.core.metrics.DefaultMetricsCollectorConfig; | ||
| import com.couchbase.client.java.cluster.BucketSettings; | ||
| import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| public class CouchbaseUtil { | ||
|
|
||
| public static DefaultCouchbaseEnvironment.Builder envBuilder( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this class is duplicated for 2.6 because the return types of methods in the builder class have changed, class compiled agains older version of the library won't work with newer version |
||
| BucketSettings bucketSettings, int carrierDirectPort, int httpDirectPort) { | ||
| // Couchbase seems to be really slow to start sometimes | ||
| long timeout = TimeUnit.SECONDS.toMillis(20); | ||
| return DefaultCouchbaseEnvironment.builder() | ||
| .bootstrapCarrierDirectPort(carrierDirectPort) | ||
| .bootstrapHttpDirectPort(httpDirectPort) | ||
| // settings to try to reduce variability in the tests: | ||
| .runtimeMetricsCollectorConfig(DefaultMetricsCollectorConfig.create(0, TimeUnit.DAYS)) | ||
| .networkLatencyMetricsCollectorConfig( | ||
| DefaultLatencyMetricsCollectorConfig.create(0, TimeUnit.DAYS)) | ||
| .computationPoolSize(1) | ||
| .connectTimeout(timeout) | ||
| .disconnectTimeout(timeout) | ||
| .kvTimeout(timeout) | ||
| .managementTimeout(timeout) | ||
| .queryTimeout(timeout) | ||
| .viewTimeout(timeout) | ||
| .keepAliveTimeout(timeout) | ||
| .searchTimeout(timeout) | ||
| .analyticsTimeout(timeout) | ||
| .socketConnectTimeout((int) timeout); | ||
| } | ||
|
|
||
| private CouchbaseUtil() {} | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0.springdata; | ||
|
|
||
| import com.couchbase.client.java.cluster.BucketSettings; | ||
| import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | ||
| import io.opentelemetry.instrumentation.couchbase.springdata.AbstractCouchbaseSpringRepositoryTest; | ||
| import io.opentelemetry.instrumentation.couchbase.springdata.TestDocument; | ||
| import io.opentelemetry.instrumentation.couchbase.springdata.TestRepository; | ||
| import io.opentelemetry.javaagent.instrumentation.couchbase.v2_0.CouchbaseUtil; | ||
|
|
||
| class CouchbaseSpringRepositoryTest extends AbstractCouchbaseSpringRepositoryTest { | ||
|
|
||
| @Override | ||
| protected DefaultCouchbaseEnvironment.Builder envBuilder( | ||
| BucketSettings bucketSettings, int carrierDirectPort, int httpDirectPort) { | ||
| return CouchbaseUtil.envBuilder(bucketSettings, carrierDirectPort, httpDirectPort); | ||
| } | ||
|
|
||
| @Override | ||
| protected TestDocument findById(TestRepository repository, String id) { | ||
| return repository.findOne(id); | ||
| } | ||
|
|
||
| @Override | ||
| protected void deleteById(TestRepository repository, String id) { | ||
| repository.delete(id); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.javaagent.instrumentation.couchbase.v2_0.springdata; | ||
|
|
||
| import com.couchbase.client.java.cluster.BucketSettings; | ||
| import com.couchbase.client.java.env.DefaultCouchbaseEnvironment; | ||
| import io.opentelemetry.instrumentation.couchbase.springdata.AbstractCouchbaseSpringTemplateTest; | ||
| import io.opentelemetry.javaagent.instrumentation.couchbase.v2_0.CouchbaseUtil; | ||
|
|
||
| class CouchbaseSpringTemplateTest extends AbstractCouchbaseSpringTemplateTest { | ||
|
|
||
| @Override | ||
| protected DefaultCouchbaseEnvironment.Builder envBuilder( | ||
| BucketSettings bucketSettings, int carrierDirectPort, int httpDirectPort) { | ||
| return CouchbaseUtil.envBuilder(bucketSettings, carrierDirectPort, httpDirectPort); | ||
| } | ||
| } |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add the
test-indylabel to this PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now indy tests are run by default, that is how I noticed that they failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, good to know, thanks!