mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
zblueslip: Store more_info and stack as well in the logs.
Now, the get_test_logs() returns an array of objects instead
of an array of strings as follows:
[{
message: "something",
more_info: {},
stack: {},
}]
This commit is contained in:
committed by
showell
parent
61f8a6fd55
commit
e14dbecdd1
@@ -267,7 +267,7 @@ run_test('retry', () => {
|
||||
});
|
||||
|
||||
assert.equal(blueslip.get_test_logs('log').length, 1);
|
||||
assert.equal(blueslip.get_test_logs('log')[0], 'Retrying idempotent[object Object]');
|
||||
assert.equal(blueslip.get_test_logs('log')[0].message, 'Retrying idempotent[object Object]');
|
||||
blueslip.clear_test_data();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ run_test('report_late_add', () => {
|
||||
reload.is_in_progress = true;
|
||||
people.report_late_add(55, 'foo@example.com');
|
||||
assert.equal(blueslip.get_test_logs('log').length, 1);
|
||||
assert.equal(blueslip.get_test_logs('log')[0], 'Added user late: user_id=55 email=foo@example.com');
|
||||
assert.equal(blueslip.get_test_logs('log')[0].message, 'Added user late: user_id=55 email=foo@example.com');
|
||||
assert.equal(blueslip.get_test_logs('error').length, 0);
|
||||
blueslip.clear_test_data();
|
||||
});
|
||||
|
||||
@@ -60,13 +60,13 @@ exports.make_zblueslip = function (opts) {
|
||||
Object.keys(opts).forEach(name => {
|
||||
if (!opts[name]) {
|
||||
// should just log the message.
|
||||
lib[name] = function (message) {
|
||||
lib.test_logs[name].push(message);
|
||||
lib[name] = function (message, more_info, stack) {
|
||||
lib.test_logs[name].push({message, more_info, stack});
|
||||
};
|
||||
return;
|
||||
}
|
||||
lib[name] = function (message) {
|
||||
lib.test_logs[name].push(message);
|
||||
lib[name] = function (message, more_info, stack) {
|
||||
lib.test_logs[name].push({message, more_info, stack});
|
||||
const exact_match_fail = lib.test_data[name].indexOf(message) === -1;
|
||||
const string_match_fail = lib.test_data[name].indexOf(message.toString()) === -1;
|
||||
if (exact_match_fail && string_match_fail) {
|
||||
|
||||
Reference in New Issue
Block a user