Skip to content

Commit

Permalink
Add one more script
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers committed Nov 11, 2024
1 parent 5b28c3c commit a3f2b89
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
16 changes: 16 additions & 0 deletions platform/android/scripts/run-benchmark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

./gradlew assembleLegacyRelease assembleLegacyReleaseAndroidTest -PtestBuildType=release

export AWS_DEVICE_FARM_PROJECT_ARN="arn:aws:devicefarm:us-west-2:373521797162:project:20687d72-0e46-403e-8f03-0941850665bc"
export AWS_DEVICE_FARM_DEVICE_POOL_ARN="arn:aws:devicefarm:us-west-2:373521797162:devicepool:20687d72-0e46-403e-8f03-0941850665bc/b4d75cb6-f210-4927-b94e-17eae054fea7"
export appType=ANDROID_APP
export appFile="MapLibreAndroidTestApp/build/outputs/apk/legacy/release/MapLibreAndroidTestApp-legacy-release.apk"
export testFile="MapLibreAndroidTestApp/build/outputs/apk/androidTest/legacy/release/MapLibreAndroidTestApp-legacy-release-androidTest.apk"
export testType="INSTRUMENTATION"
export testPackageType="INSTRUMENTATION_TEST_PACKAGE"
export testSpecArn="arn:aws:devicefarm:us-west-2:373521797162:upload:20687d72-0e46-403e-8f03-0941850665bc/14862afb-cf88-44aa-9f1e-5131cbb22f01"
export testFilter="org.maplibre.android.benchmark.Benchmark"
export name="Android Benchmark"

../../scripts/aws-device-farm/aws-device-farm-run.sh
9 changes: 7 additions & 2 deletions scripts/aws-device-farm/store-test-artifacts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,15 @@ async function storeRunArtifacts(arnArr, outputDir) {
await Promise.all((artifacts.artifacts || []).map(async (artifact) => {
if (!artifact.name || !artifact.url || !artifact.type) return;
if (artifactsToDownload.includes(artifact.type)) {
const filename = `${artifact.name.replaceAll(' ', '_')}-${crypto.randomBytes(10).toString('hex')}.${artifact.extension}`;
if (!artifact.arn) return;
const destination = path.join(outputDir, `${Buffer.from(artifact.arn).toString('base64')}.${artifact.extension}`);
try {
await fs.promises.access(destination);
return; // already exists
} catch (err) {
}
const res = await fetch(artifact.url);
if (!res.ok || !res.body) return;
const destination = path.resolve(outputDir, filename);
const fileStream = fs.createWriteStream(destination, { flags: 'wx' });
await finished(Readable.fromWeb(/** @type {any} **/(res.body)).pipe(fileStream));
}
Expand Down

0 comments on commit a3f2b89

Please sign in to comment.