[test-runner] Move probe related command line args to manifest

- Move probe related command line arguments to manifest, example:

  "probes": ["probeGFX", "probeNetwork", "probeMemory"],
  "metric_path": "metrics/linux"

- Use manifest file name as a postfix for a result page
- Move injected probes 'begin' section before map object creation
- Generalize artifact storing shell script
This commit is contained in:
Alexander Shalamov
2019-11-26 11:54:08 +02:00
parent f10097640a
commit 2f8501043c
6 changed files with 49 additions and 41 deletions

View File

@@ -44,6 +44,10 @@ const std::string& Manifest::getResultPath() const {
return resultPath;
}
const std::set<std::string>& Manifest::getProbes() const {
return probes;
}
void Manifest::doShuffle(uint32_t seed) {
std::seed_seq sequence{seed};
std::mt19937 shuffler(sequence);
@@ -389,6 +393,25 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife
manifest.ignores = parseIgnores(ignorePaths);
}
if (document.HasMember("probes")) {
const auto& probesValue = document["probes"];
if (!probesValue.IsArray()) {
mbgl::Log::Warning(mbgl::Event::General,
"Provided probes inside the manifest file: %s is not a valid array",
filePath.c_str());
return mbgl::nullopt;
}
for (const auto& value : probesValue.GetArray()) {
if (!value.IsString()) {
mbgl::Log::Warning(mbgl::Event::General,
"Invalid probe type is provoided inside the manifest file: %s",
filePath.c_str());
return mbgl::nullopt;
}
manifest.probes.emplace(value.GetString());
}
}
manifest.testRootPath = enbaleProbeTest ? probeTestPath.string() : baseTestPath.string();
if (manifest.testRootPath.back() == '/') {
manifest.testRootPath.pop_back();