Reputation: 3469
Is there a way to download Firebase Test Lab matrix artifacts using Cloud Functions and probably save ourselves the trouble of creating another service account to authenticate with GCloud CLI?
exports.testMatrixCompletion = functions.testLab.testMatrix().onComplete(testMatrix => {
// TestMatrix captures details about a test run: https://firebase.google.com/docs/reference/functions/firebase-functions.testlab.testmatrix
const matrixId = testMatrix.testMatrixId;
switch (testMatrix.state) {
case 'FINISHED':
console.log(`Test matrix ${matrixId} finished with outcome: ${testMatrix.outcomeSummary}`);
break;
case 'INVALID':
console.log(`Test matrix ${matrixId} was marked as invalid: ${testMatrix.invalidMatrixDetails}`);
break;
default:
console.log(`Test matrix ${matrixId} completed with state ${testMatrix.state}`);
}
console.log(`Test matrix ${matrixId} completed with client details ${testMatrix.clientInfo}`);
if (!!testMatrix.resultStorage.resultsUrl) {
console.log(`Test results are available at ${testMatrix.resultStorage.resultsUrl}`);
}
// TODO: Cache the test matrix results and store it to a cloud storage solution where download url of files are accessible for public,
// one quick solution is to use Firebase Cloud Storage here to avoid extra authentication with tools like GCloud CLI and get the download url after success upload.
return true;
});
Currently we have this simple setup and we are hoping to download files from here.
Upvotes: 0
Views: 94