Skip to content

Commit 9b5351f

Browse files
Fix assets ordering for proper AzureEngine script upload and validation
1 parent 64f6e9d commit 9b5351f

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
branch: master
4444
file_pattern: 'pom.xml */pom.xml README.md docs/index.md docs/guide/**'
4545
- name: package release
46-
run: mvn --batch-mode --no-transfer-progress clean install -Dfailsafe.skipAfterFailureCount=1 --settings .github/settings.xml
46+
run: mvn --batch-mode --no-transfer-progress clean install --settings .github/settings.xml
4747
env:
4848
BZ_TOKEN: ${{ secrets.BZ_TOKEN }}
4949
OCTOPERF_API_KEY: ${{ secrets.OCTOPERF_API_KEY }}

jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Call<Void> updateAppComponents(@Path("testId") String testId,
226226
Call<Void> deleteTestFile(@Path("testId") String testId, @Path("fileName") String fileName);
227227

228228
@PUT("tests/{testId}/files/{fileName}" + API_VERSION)
229-
Call<Void> uploadTestFile(@Path("testId") String testId, @Path("fileName") String fileName,
229+
Call<FileInfo> uploadTestFile(@Path("testId") String testId, @Path("fileName") String fileName,
230230
@Body RequestBody testFile);
231231

232232
@GET("tests/{testId}/files/{fileName}" + API_VERSION)
@@ -357,8 +357,8 @@ public void deleteTestFile(String fileName, String testId) throws IOException {
357357
execApiCall(loadTestApi.deleteTestFile(testId, fileName));
358358
}
359359

360-
public void uploadTestFile(File file, String fileName, String testId) throws IOException {
361-
execApiCall(loadTestApi.uploadTestFile(testId, fileName,
360+
public FileInfo uploadTestFile(File file, String fileName, String testId) throws IOException {
361+
return execApiCall(loadTestApi.uploadTestFile(testId, fileName,
362362
RequestBody.create(MediaType.get("application/octet-stream"), file)));
363363
}
364364

jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,6 @@ private void updateAppComponents(LoadTest loadTest) throws IOException {
483483

484484
private void uploadTestFiles(File jmxFile, HashTree tree, BuildTreeContext context,
485485
LoadTest loadTest) throws IOException, InterruptedException, TimeoutException {
486-
LOG.info("Uploading test script and asset files");
487486
for (File f : assets) {
488487
context.processAssetFile(f.getPath());
489488
}
@@ -492,17 +491,17 @@ private void uploadTestFiles(File jmxFile, HashTree tree, BuildTreeContext conte
492491
}
493492
context.processAssetFile(jmxFile.getPath());
494493
for (Map.Entry<String, File> asset : context.getAssetFiles().entrySet()) {
495-
apiClient.uploadTestFile(asset.getValue(), asset.getKey(), loadTest.getTestId());
496-
awaitValidatedTestFile(asset.getKey(), loadTest.getTestId());
494+
FileInfo testFile = apiClient.uploadTestFile(asset.getValue(), asset.getKey(),
495+
loadTest.getTestId());
496+
awaitValidatedTestFile(testFile, loadTest.getTestId());
497497
}
498498
}
499499

500-
private void awaitValidatedTestFile(String fileName, String testId)
500+
private void awaitValidatedTestFile(FileInfo testFile, String testId)
501501
throws IOException, InterruptedException, TimeoutException {
502-
LOG.info("Validating test script");
503-
EntityProvider<FileInfo> fileProvider = () -> apiClient.findTestFile(fileName, testId);
504-
awaitStatus(fileProvider.get(), fileProvider, FileInfo::isPendingValidation,
505-
FileInfo::isSuccessValidation, VALIDATION_TIMEOUT,
502+
String fileName = testFile.getFileName();
503+
awaitStatus(testFile, () -> apiClient.findTestFile(fileName, testId),
504+
FileInfo::isPendingValidation, FileInfo::isSuccessValidation, VALIDATION_TIMEOUT,
506505
"test file '" + fileName + "' validation", "test plan",
507506
FileInfo::getValidationFailureDetails);
508507
}

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/core/BuildTreeContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public HashTree buildTreeFor(DslTestElement element, HashTree parentTree) {
111111
}
112112

113113
public static BuildTreeContext buildRemoteExecutionContext() {
114-
return new BuildTreeContext(null, new LinkedHashMap<>(), new HashMap<>());
114+
return new BuildTreeContext(null, new LinkedHashMap<>(), new LinkedHashMap<>());
115115
}
116116

117117
public String processAssetFile(String assetPath) {

0 commit comments

Comments
 (0)