Open ufobat opened 7 years ago
On my local Windows machine, all tests pass. The failing test is here.
It appears that .... the AppVeyor CI server is too fast !
my $before-log = DateTime.new( now );
Log::Any.log( :pipeline( 'test-2' ), :msg('test-2'), :severity( 'trace' ), :category( 'test-category' ) );
my $after-log = DateTime.new( now );
with $a.logs[*-1] {
like $_, /^ (<-[\s]>+) \s 'trace test-category test-2' $/, 'Log with formatter in test-2 pipeline';
# Check if log dateTime is after $before-log, and before $after-log
with $_ ~~ /^ (<-[\s]>+)/ {
my $log-dateTime = DateTime.new( $_.Str );
say $before-log;
say $log-dateTime;
say $after-log;
if $before-log < $log-dateTime < $after-log {
pass "Log DateTime is in the interval";
} else {
flunk "Log DateTime is not in the interval";
}
} else {
flunk "Failed to extract dateTime from log message";
}
} else {
flunk 'Log with formatter in test-2 pipeline';
}
executed by the CI server :
2017-06-29T15:11:17.805007Z
2017-06-29T15:11:17.805007Z
2017-06-29T15:11:17.805007Z
not ok 31 - Log DateTime is not in the interval