Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assume.assumeNotNull;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
Expand All @@ -43,6 +44,10 @@ public class ITUniverseDomainTest {

@BeforeClass
public static void setUp() throws Exception {
assumeNotNull(TEST_UNIVERSE_DOMAIN);
assumeNotNull(TEST_PROJECT_ID);
assumeNotNull(TEST_UNIVERSE_LOCATION);
assumeNotNull(CREDENTIAL_PATH);
GoogleCredentials creds =
ServiceAccountCredentials.fromStream(Files.newInputStream(Paths.get(CREDENTIAL_PATH)))
.toBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
ProtectedBucketNames protectedBucketNames = new ProtectedBucketNames();
TestRunScopedInstance<StorageInstance> storageJson =
TestRunScopedInstance.of(
"STORAGE_JSON_" + backend.name(),
"fixture/STORAGE/[JSON][" + backend.name() + "]",
() -> {
HttpStorageOptions.Builder optionsBuilder;
switch (backend) {
Expand All @@ -108,7 +108,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<StorageInstance> storageGrpc =
TestRunScopedInstance.of(
"STORAGE_GRPC_" + backend.name(),
"fixture/STORAGE/[GRPC][" + backend.name() + "]",
() -> {
GrpcStorageOptions.Builder optionsBuilder;
switch (backend) {
Expand Down Expand Up @@ -137,7 +137,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<StorageControlInstance> ctrl =
TestRunScopedInstance.of(
"STORAGE_CONTROL_" + backend.name(),
"fixture/STORAGE_CONTROL/[" + backend.name() + "]",
() -> {
StorageControlSettings.Builder builder;
switch (backend) {
Expand Down Expand Up @@ -176,7 +176,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<BucketInfoShim> bucket =
TestRunScopedInstance.of(
"BUCKET_" + backend.name(),
"fixture/BUCKET/[" + backend.name() + "]",
() -> {
String bucketName = String.format("java-storage-grpc-%s", UUID.randomUUID());
protectedBucketNames.add(bucketName);
Expand All @@ -185,7 +185,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<BucketInfoShim> bucketRp =
TestRunScopedInstance.of(
"BUCKET_REQUESTER_PAYS_" + backend.name(),
"fixture/BUCKET/[" + backend.name() + "]/REQUESTER_PAYS",
() -> {
String bucketName = String.format("java-storage-grpc-rp-%s", UUID.randomUUID());
protectedBucketNames.add(bucketName);
Expand All @@ -196,7 +196,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<BucketInfoShim> bucketVersioned =
TestRunScopedInstance.of(
"BUCKET_VERSIONED_" + backend.name(),
"fixture/BUCKET/[" + backend.name() + "]/VERSIONED",
() -> {
String bucketName = String.format("java-storage-grpc-v-%s", UUID.randomUUID());
protectedBucketNames.add(bucketName);
Expand All @@ -207,7 +207,7 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<BucketInfoShim> bucketHns =
TestRunScopedInstance.of(
"BUCKET_HNS_" + backend.name(),
"fixture/BUCKET/[" + backend.name() + "]/HNS",
() -> {
String bucketName = String.format("java-storage-grpc-hns-%s", UUID.randomUUID());
protectedBucketNames.add(bucketName);
Expand All @@ -225,22 +225,23 @@ static BackendResources of(Backend backend, TestRunScopedInstance<OtelSdkShim> o
});
TestRunScopedInstance<ObjectsFixture> objectsFixture =
TestRunScopedInstance.of(
"OBJECTS_FIXTURE_" + backend.name(),
"fixture/OBJECTS/[" + backend.name() + "]",
() -> new ObjectsFixture(storageJson.get().getStorage(), bucket.get().getBucketInfo()));
TestRunScopedInstance<ObjectsFixture> objectsFixtureRp =
TestRunScopedInstance.of(
"OBJECTS_FIXTURE_REQUESTER_PAYS_" + backend.name(),
"fixture/OBJECTS/[" + backend.name() + "]/REQUESTER_PAYS",
() ->
new ObjectsFixture(storageJson.get().getStorage(), bucketRp.get().getBucketInfo()));
TestRunScopedInstance<ObjectsFixture> objectsFixtureHns =
TestRunScopedInstance.of(
"OBJECTS_FIXTURE_HNS_" + backend.name(),
"fixture/OBJECTS/[" + backend.name() + "]/HNS",
() ->
new ObjectsFixture(
storageJson.get().getStorage(), bucketHns.get().getBucketInfo()));
TestRunScopedInstance<KmsFixture> kmsFixture =
TestRunScopedInstance.of(
"KMS_FIXTURE_" + backend.name(), () -> KmsFixture.of(storageJson.get().getStorage()));
"fixture/KMS/[" + backend.name() + "]",
() -> KmsFixture.of(storageJson.get().getStorage()));

return new BackendResources(
backend,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ public final class Registry extends RunListener {
new ThreadFactoryBuilder().setDaemon(true).setNameFormat("test-run-%d").build()));

private final TestRunScopedInstance<TestBench> testBench =
TestRunScopedInstance.of("TEST_BENCH", () -> TestBench.newBuilder().build());
TestRunScopedInstance.of("fixture/TEST_BENCH", () -> TestBench.newBuilder().build());

private final TestRunScopedInstance<Generator> generator =
TestRunScopedInstance.of("GENERATOR", Generator::new);
TestRunScopedInstance.of("fixture/GENERATOR", Generator::new);

final TestRunScopedInstance<OtelSdkShim> otelSdk =
TestRunScopedInstance.of(
"OTEL_SDK",
"fixture/OTEL_SDK",
() -> {
String projectId = StorageOptions.getDefaultInstance().getProjectId();
return new OtelSdkShim(projectId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public T get() {
if (instance == null) {
// if we don't short-circuit for OTEL_SDK we will cause a stack overflow, because we would
// be trying to get our instance to record that we're starting our instance.
if (name.equals("OTEL_SDK")) {
if (name.equals("fixture/OTEL_SDK")) {
T tmp = ctor.get();
tmp.start();
instance = tmp;
Expand Down
Loading