Skip to content
Open
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
1 change: 0 additions & 1 deletion eng/versioning/external_dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ org.springframework.boot:spring-boot-starter-parent;2.7.18

## Test dependency versions
com.github.docker-java:docker-java;3.4.0
com.github.tomakehurst:wiremock-jre8-standalone;2.35.2
com.microsoft.azure:adal4j;1.6.5
com.microsoft.azure:azure;1.24.1
com.microsoft.azure:azure-mgmt-graph-rbac;1.3.0
Expand Down
6 changes: 0 additions & 6 deletions sdk/compute/azure-resourcemanager-compute/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,6 @@
<version>2.17.0</version> <!-- {x-version-update;commons-io:commons-io;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>2.35.2</version> <!-- {x-version-update;com.github.tomakehurst:wiremock-jre8-standalone;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down
11 changes: 2 additions & 9 deletions sdk/core/azure-core-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,8 @@
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.16.6</version> <!-- {x-version-update;com.azure:azure-core-http-netty;current} -->
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>2.35.2</version> <!-- {x-version-update;com.github.tomakehurst:wiremock-jre8-standalone;external_dependency} -->
<artifactId>azure-core-test</artifactId>
<version>1.27.0-beta.17</version> <!-- {x-version-update;com.azure:azure-core-test;current} -->
<scope>test</scope>
</dependency>
</dependencies>
Expand Down

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions sdk/core/azure-core-perf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ mvn install
java -jar .\target\azure-core-perf-1.0.0-beta.1-jar-with-dependencies.jar bytebufferreceive
```

### Running with Wiremock

Just run it with extra parameters.

```shell
mvn install
java -jar .\target\azure-core-perf-1.0.0-beta.1-jar-with-dependencies.jar binarydatareceive --http-client netty --backend-type wiremock
```

### Running with Blobs

1. Create Storage account. Premium Blobs are recommended.
Expand Down
24 changes: 0 additions & 24 deletions sdk/core/azure-core-perf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<artifactId>perf-test-core</artifactId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:perf-test-core;current} -->
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>2.35.2</version> <!-- {x-version-update;com.github.tomakehurst:wiremock-jre8-standalone;external_dependency} -->
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand All @@ -72,23 +67,4 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>com.github.tomakehurst:wiremock-jre8-standalone:[2.35.2]</include> <!-- {x-include-update;com.github.tomakehurst:wiremock-jre8-standalone;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ public class CorePerfStressOptions extends PerfStressOptions {

@Parameter(
names = { "--backend-type" },
description = "The backend type used for tests. " + "Options are mock, blobs or wiremock. "
+ "Defaults to mock.")
description = "The backend type used for tests. Options are mock or blobs. Defaults to mock.")
private BackendType backendType = BackendType.MOCK;

@Parameter(
names = { "--binary-data-source" },
description = "The binary data source used for tests that use BinaryData. "
+ "Options are bytes, file or stream. " + "Defaults to file.")
+ "Options are bytes, file or stream. Defaults to file.")
private BinaryDataSource binaryDataSource = BinaryDataSource.FILE;

@Parameter(
Expand All @@ -26,7 +25,7 @@ public class CorePerfStressOptions extends PerfStressOptions {
private boolean includePipelinePolicies;

/**
* The backend type used for tests. Options are mock, blobs or wiremock. Defaults to mock.
* The backend type used for tests. Options are mock or blobs. Defaults to mock.
* @return The backend type used for tests.
*/
public BackendType getBackendType() {
Expand All @@ -52,7 +51,7 @@ public BinaryDataSource getBinaryDataSource() {
}

public enum BackendType {
MOCK, BLOBS, WIREMOCK
MOCK, BLOBS
}

public enum BinaryDataSource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
import com.azure.perf.test.core.PerfStressTest;
import com.azure.perf.test.core.RepeatingInputStream;
import com.azure.perf.test.core.TestDataCreationHelper;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
import reactor.core.publisher.Mono;

import java.io.IOException;
import java.nio.file.Files;
Expand All @@ -44,10 +41,6 @@
import java.util.function.Function;
import java.util.function.Supplier;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.any;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathMatching;

public abstract class RestProxyTestBase<TOptions extends CorePerfStressOptions> extends PerfStressTest<TOptions> {
private static final AtomicInteger ID_SOURCE = new AtomicInteger();

Expand All @@ -57,8 +50,6 @@ public abstract class RestProxyTestBase<TOptions extends CorePerfStressOptions>
protected final MyRestProxyService service;
protected final HttpPipeline httpPipeline;

private final WireMockServer wireMockServer;

public RestProxyTestBase(TOptions options) {
this(options, null, null);
}
Expand All @@ -70,18 +61,13 @@ public RestProxyTestBase(TOptions options, Function<HttpRequest, HttpResponse> m
public RestProxyTestBase(TOptions options, Function<HttpRequest, HttpResponse> mockResponseSupplier,
Tracer tracer) {
super(options);
if (options.getBackendType() == CorePerfStressOptions.BackendType.WIREMOCK) {
wireMockServer = createWireMockServer(mockResponseSupplier);
endpoint = wireMockServer.baseUrl();
} else if (options.getBackendType() == CorePerfStressOptions.BackendType.BLOBS) {
if (options.getBackendType() == CorePerfStressOptions.BackendType.BLOBS) {
String containerSASUrl = Configuration.getGlobalConfiguration().get("AZURE_STORAGE_CONTAINER_SAS_URL");
if (CoreUtils.isNullOrEmpty(containerSASUrl)) {
throw new IllegalStateException("Environment variable AZURE_STORAGE_CONTAINER_SAS_URL must be set");
}
wireMockServer = null;
endpoint = containerSASUrl;
} else {
wireMockServer = null;
endpoint = "http://unused";
}
HttpClient httpClient = createHttpClient(options, mockResponseSupplier);
Expand All @@ -93,15 +79,6 @@ public RestProxyTestBase(TOptions options, Function<HttpRequest, HttpResponse> m
service = RestProxy.create(MyRestProxyService.class, httpPipeline);
}

@Override
public Mono<Void> cleanupAsync() {
return super.cleanupAsync().then(Mono.fromRunnable(() -> {
if (wireMockServer != null) {
wireMockServer.shutdown();
}
}));
}

private HttpPipelinePolicy[] createPipelinePolicies(TOptions options) {
List<HttpPipelinePolicy> policies = new ArrayList<>();
if (options.getBackendType() == CorePerfStressOptions.BackendType.BLOBS) {
Expand Down Expand Up @@ -131,24 +108,6 @@ private HttpClient createHttpClient(TOptions options, Function<HttpRequest, Http
}
}

private static WireMockServer createWireMockServer(Function<HttpRequest, HttpResponse> mockResponseSupplier) {
WireMockServer server = new WireMockServer(
WireMockConfiguration.options().dynamicPort().disableRequestJournal().gzipDisabled(true));

if (mockResponseSupplier == null) {
server.stubFor(any(urlPathMatching("/(RawData|UserDatabase|BinaryData).*")));
} else {
HttpResponse response = mockResponseSupplier.apply(null);
server.stubFor(any(urlPathMatching("/(RawData|UserDatabase|BinaryData).*"))
.willReturn(aResponse().withBody(response.getBodyAsByteArray().block())
.withStatus(response.getStatusCode())
.withHeader("Content-Type", response.getHeaderValue(HttpHeaderName.CONTENT_TYPE))));
}

server.start();
return server;
}

public static HttpResponse createMockResponse(HttpRequest httpRequest, String contentType, byte[] bodyBytes) {
HttpHeaders headers = new HttpHeaders().set(HttpHeaderName.CONTENT_TYPE, contentType);
return new MockHttpResponse(httpRequest, 200, headers, bodyBytes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,15 @@ private static Stream<Arguments> providePerfTests() {
private static Stream<String[]> generateArgsCombination() {
List<String[]> args = new ArrayList<>();

for (BackendType backendType : Arrays.asList(BackendType.MOCK, BackendType.WIREMOCK)) {
for (HttpClientType httpClientType : Arrays.asList(NETTY, OKHTTP)) {
for (BinaryDataSource binaryDataSource : BinaryDataSource.values()) {
for (Boolean includePipelinePolicies : Arrays.asList(true, false)) {
List<String> argLine = new ArrayList<>(
Arrays.asList("unused", "--backend-type", backendType.name(), "--http-client",
httpClientType.toString(), "--binary-data-source", binaryDataSource.name()));
if (includePipelinePolicies) {
argLine.add("--include-pipeline-policies");
}
args.add(argLine.toArray(new String[0]));
for (HttpClientType httpClientType : Arrays.asList(NETTY, OKHTTP)) {
for (BinaryDataSource binaryDataSource : BinaryDataSource.values()) {
for (Boolean includePipelinePolicies : Arrays.asList(true, false)) {
List<String> argLine = new ArrayList<>(Arrays.asList("unused", "--backend-type", "mock",
"--http-client", httpClientType.toString(), "--binary-data-source", binaryDataSource.name()));
if (includePipelinePolicies) {
argLine.add("--include-pipeline-policies");
}
args.add(argLine.toArray(new String[0]));
}
}
}
Expand Down
Loading