diff options
| author | Billy O'Neal <bion@microsoft.com> | 2021-01-14 08:41:53 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-14 08:41:53 -0800 |
| commit | 3f3d9a615a4f86ce892613885f00ca315cfe1e7e (patch) | |
| tree | a6324a9596ca5f8f75ec1cb462e20190883dbdcd | |
| parent | fd67439f01bfec989f7b1505f3b2f10f771470a3 (diff) | |
| download | vcpkg-3f3d9a615a4f86ce892613885f00ca315cfe1e7e.tar.gz vcpkg-3f3d9a615a4f86ce892613885f00ca315cfe1e7e.zip | |
[vcpkg] Fix incorrect handling of messages for permenantly disabled metrics. (#15636)
Fixes #15630
| -rw-r--r-- | scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 | 6 | ||||
| -rw-r--r-- | toolsrc/src/vcpkg.cpp | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 b/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 index efec472b4..5ad7616b4 100644 --- a/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 +++ b/scripts/azure-pipelines/end-to-end-tests-dir/disable-metrics.ps1 @@ -41,6 +41,12 @@ try { throw "Environment variable did not disable metrics."
}
+ # Also test that you get no message without --sendmetrics
+ $vcpkgOutput = Run-Vcpkg list
+ if ($vcpkgOutput -contains $metricsAreDisabledMessage) {
+ throw "Disabled metrics emit message even without --sendmetrics"
+ }
+
if (-Not (Test-Metrics-Enabled '--no-disable-metrics')) {
throw "Environment variable to disable metrics could not be overridden by switch."
}
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index f3a6ac6a0..783cb0429 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -256,7 +256,7 @@ int main(const int argc, const char* const* const argv) metrics->set_send_metrics(*p); } - if (args.send_metrics.value_or(true) && !metrics->metrics_enabled()) + if (args.send_metrics.value_or(false) && !metrics->metrics_enabled()) { System::print2(System::Color::warning, "Warning: passed --sendmetrics, but metrics are disabled.\n"); } |
