Changeset 1310:3882f8f3b2bc in nginx-tests


Ignore:
Timestamp:
03/29/18 14:01:31 (2 years ago)
Author:
Dmitry Volyntsev <xeioex@…>
Branch:
default
Phase:
public
Message:

Tests: added njs extended logging tests.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • js.t

    r1247 r1310  
    179179
    180180    function test_log(req, res) {
    181         req.log("SEE-THIS");
     181        req.log("SEE-THIS-LOG");
     182        req.warn("SEE-THIS-WARN");
     183        req.error("SEE-THIS-ERROR");
    182184    }
    183185
     
    262264EOF
    263265
    264 $t->try_run('no njs available')->plan(22);
     266$t->try_run('no njs available')->plan(24);
    265267
    266268###############################################################################
     
    303305$t->stop();
    304306
    305 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'log js');
     307ok(index($t->read_file('error.log'), 'SEE-THIS-LOG') > 0, 'log js');
     308ok(index($t->read_file('error.log'), 'SEE-THIS-WARN') > 0, 'warn js');
     309ok(index($t->read_file('error.log'), 'SEE-THIS-ERROR') > 0, 'error js');
    306310ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0,
    307311   'js_set backtrace');
  • stream_js.t

    r1248 r1310  
    134134
    135135    function js_log(sess) {
    136         sess.log("SEE-THIS");
     136        sess.log("SEE-THIS-LOG");
     137        sess.warn("SEE-THIS-WARN");
     138        sess.error("SEE-THIS-ERROR");
    137139    }
    138140
     
    200202
    201203$t->run_daemon(\&stream_daemon, port(8090));
    202 $t->try_run('no stream njs available')->plan(14);
     204$t->try_run('no stream njs available')->plan(16);
    203205$t->waitforsocket('127.0.0.1:' . port(8090));
    204206
     
    224226$t->stop();
    225227
    226 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'stream js log');
     228ok(index($t->read_file('error.log'), 'SEE-THIS-LOG') > 0, 'stream js log');
     229ok(index($t->read_file('error.log'), 'SEE-THIS-WARN') > 0, 'stream js warn');
     230ok(index($t->read_file('error.log'), 'SEE-THIS-ERROR') > 0, 'stream js error');
    227231ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0,
    228232   'stream js_preread backtrace');
Note: See TracChangeset for help on using the changeset viewer.