Skip to content

Commit

Permalink
ci: skip file_log_test.v on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Nov 14, 2023
1 parent 55cac88 commit 8b71639
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vlib/log/file_log_test.v
Expand Up @@ -3,6 +3,10 @@ import log
import rand

fn test_reopen() {
if os.user_os() == 'windows' && os.getenv('SKIP_TEST_REOPEN') == '' {
eprintln('skip renaming and reopening a log file on windows')
exit(0)
}
lfolder := os.join_path(os.vtmp_dir(), rand.ulid())
lpath1 := os.join_path(lfolder, 'current.log')
lpath2 := os.join_path(lfolder, 'current.log.2')
Expand All @@ -14,7 +18,7 @@ fn test_reopen() {
l.warn('one warning')
l.error('one error')
// simulate a log rotation, by moving the log file
os.mv(lpath1, lpath2)!
os.rename(lpath1, lpath2)!
l.warn('another warning')
// call reopen, note that the message from above, should be in the new file lpath2:
l.reopen()!
Expand Down

0 comments on commit 8b71639

Please sign in to comment.