summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Zolnierz <nicholas.zolnierz@mongodb.com>2022-11-14 16:14:55 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-14 22:20:00 +0000
commit607e613725fffbab18c372627d74e8607077ee82 (patch)
treea57f10833aedf5c9510da5dbb9da8917a8a93a49
parentd5613886915a0507b9bb8d716f63e3e4323ca17f (diff)
downloadmongo-607e613725fffbab18c372627d74e8607077ee82.tar.gz
Revert "SERVER-71237 Do not print full expected output when golden test file does not exist"
This reverts commit df38314f471a57fd273a7c0d747dfc1aeb4feaea.
-rw-r--r--src/mongo/unittest/golden_test_base.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/unittest/golden_test_base.cpp b/src/mongo/unittest/golden_test_base.cpp
index 18d7dd7197a..e8b6a9b298c 100644
--- a/src/mongo/unittest/golden_test_base.cpp
+++ b/src/mongo/unittest/golden_test_base.cpp
@@ -157,13 +157,14 @@ std::string GoldenTestContextBase::sanitizeName(const std::string& str) {
}
void GoldenTestContextBase::verifyOutput() {
+ std::string actualStr = _outStream.str();
+
fs::path goldenDataPath = getGoldenDataPath();
if (!fs::exists(goldenDataPath)) {
failResultMismatch(
- "<omitted>", boost::none, "Golden data file doesn't exist: {}"_format(goldenDataPath));
+ actualStr, boost::none, "Golden data file doesn't exist: {}"_format(goldenDataPath));
}
- std::string actualStr = _outStream.str();
std::string expectedStr = readFile(goldenDataPath);
if (actualStr != expectedStr) {
failResultMismatch(actualStr, expectedStr, "Actual result doesn't match golden data.");