mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
👷 Fix CI target selection and test expectations
This commit is contained in:
@@ -35,6 +35,18 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
moon test bitlogger
|
moon test bitlogger
|
||||||
|
|
||||||
- name: Run example
|
- name: Check bitlogger native
|
||||||
|
run: |
|
||||||
|
moon check bitlogger --target native
|
||||||
|
|
||||||
|
- name: Check bitlogger_async native
|
||||||
|
run: |
|
||||||
|
moon check bitlogger_async --target native
|
||||||
|
|
||||||
|
- name: Run basic example
|
||||||
run: |
|
run: |
|
||||||
moon run examples/basic
|
moon run examples/basic
|
||||||
|
|
||||||
|
- name: Check async example native
|
||||||
|
run: |
|
||||||
|
moon check examples/async_basic --target native
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ test "config subtype json helpers stringify stable shapes" {
|
|||||||
template="[{level}] {message} :: {fields}",
|
template="[{level}] {message} :: {fields}",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
content="{\"field_separator\":\",\",\"separator\":\" | \",\"show_fields\":true,\"show_level\":true,\"show_target\":false,\"show_timestamp\":false,\"template\":\"[{level}] {message} :: {fields}\"}",
|
content="{\"show_timestamp\":false,\"show_level\":true,\"show_target\":false,\"show_fields\":true,\"separator\":\" | \",\"field_separator\":\",\",\"template\":\"[{level}] {message} :: {fields}\"}",
|
||||||
)
|
)
|
||||||
inspect(
|
inspect(
|
||||||
stringify_sink_config(
|
stringify_sink_config(
|
||||||
@@ -171,7 +171,7 @@ test "config subtype json helpers stringify stable shapes" {
|
|||||||
text_formatter=TextFormatterConfig::new(show_timestamp=false),
|
text_formatter=TextFormatterConfig::new(show_timestamp=false),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
content="{\"append\":false,\"auto_flush\":false,\"kind\":\"file\",\"path\":\"demo.log\",\"rotation\":{\"max_backups\":2,\"max_bytes\":128},\"text_formatter\":{\"field_separator\":\" \",\"separator\":\" \",\"show_fields\":true,\"show_level\":true,\"show_target\":true,\"show_timestamp\":false,\"template\":\"\"}}",
|
content="{\"kind\":\"file\",\"path\":\"demo.log\",\"append\":false,\"auto_flush\":false,\"text_formatter\":{\"show_timestamp\":false,\"show_level\":true,\"show_target\":true,\"show_fields\":true,\"separator\":\" \",\"field_separator\":\" \",\"template\":\"\"},\"rotation\":{\"max_bytes\":128,\"max_backups\":2}}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +292,7 @@ test "file state json helpers stringify stable snapshots" {
|
|||||||
)
|
)
|
||||||
inspect(
|
inspect(
|
||||||
@json_parser.stringify(plain),
|
@json_parser.stringify(plain),
|
||||||
content="{\"append\":false,\"auto_flush\":true,\"available\":true,\"flush_failures\":3,\"open_failures\":1,\"path\":\"demo.log\",\"rotation\":{\"max_backups\":2,\"max_bytes\":64},\"rotation_failures\":4,\"write_failures\":2}",
|
content="{\"path\":\"demo.log\",\"available\":true,\"append\":false,\"auto_flush\":true,\"open_failures\":1,\"write_failures\":2,\"flush_failures\":3,\"rotation_failures\":4,\"rotation\":{\"max_bytes\":64,\"max_backups\":2}}",
|
||||||
)
|
)
|
||||||
inspect(
|
inspect(
|
||||||
stringify_file_sink_state(
|
stringify_file_sink_state(
|
||||||
@@ -308,7 +308,7 @@ test "file state json helpers stringify stable snapshots" {
|
|||||||
rotation_failures=0,
|
rotation_failures=0,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
content="{\"append\":true,\"auto_flush\":false,\"available\":false,\"flush_failures\":0,\"open_failures\":0,\"path\":\"plain.log\",\"rotation\":null,\"rotation_failures\":0,\"write_failures\":0}",
|
content="{\"path\":\"plain.log\",\"available\":false,\"append\":true,\"auto_flush\":false,\"open_failures\":0,\"write_failures\":0,\"flush_failures\":0,\"rotation_failures\":0,\"rotation\":null}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,7 +333,7 @@ test "runtime file state json helpers stringify queue snapshots" {
|
|||||||
)
|
)
|
||||||
inspect(
|
inspect(
|
||||||
json,
|
json,
|
||||||
content="{\"dropped_count\":5,\"file\":{\"append\":true,\"auto_flush\":false,\"available\":true,\"flush_failures\":2,\"open_failures\":0,\"path\":\"queue.log\",\"rotation\":null,\"rotation_failures\":3,\"write_failures\":1},\"pending_count\":7,\"queued\":true}",
|
content="{\"file\":{\"path\":\"queue.log\",\"available\":true,\"append\":true,\"auto_flush\":false,\"open_failures\":0,\"write_failures\":1,\"flush_failures\":2,\"rotation_failures\":3,\"rotation\":null},\"queued\":true,\"pending_count\":7,\"dropped_count\":5}",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -348,7 +348,7 @@ test "file sink policy json helpers stringify stable policies" {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
content="{\"append\":false,\"auto_flush\":true,\"rotation\":{\"max_backups\":3,\"max_bytes\":96}}",
|
content="{\"append\":false,\"auto_flush\":true,\"rotation\":{\"max_bytes\":96,\"max_backups\":3}}",
|
||||||
)
|
)
|
||||||
inspect(
|
inspect(
|
||||||
stringify_file_sink_policy(
|
stringify_file_sink_policy(
|
||||||
@@ -544,10 +544,10 @@ test "configured logger can reopen built file sink" {
|
|||||||
inspect(logger.file_reopen_truncate(), content="false")
|
inspect(logger.file_reopen_truncate(), content="false")
|
||||||
inspect(logger.file_append_mode(), content="false")
|
inspect(logger.file_append_mode(), content="false")
|
||||||
inspect(logger.file_reopen_with_current_policy(), content="false")
|
inspect(logger.file_reopen_with_current_policy(), content="false")
|
||||||
inspect(logger.file_open_failures(), content="3")
|
inspect(logger.file_open_failures(), content="4")
|
||||||
inspect(logger.file_reopen_append(), content="false")
|
inspect(logger.file_reopen_append(), content="false")
|
||||||
inspect(logger.file_append_mode(), content="true")
|
inspect(logger.file_append_mode(), content="true")
|
||||||
inspect(logger.file_open_failures(), content="4")
|
inspect(logger.file_open_failures(), content="5")
|
||||||
inspect(logger.file_reset_failure_counters(), content="true")
|
inspect(logger.file_reset_failure_counters(), content="true")
|
||||||
inspect(logger.file_open_failures(), content="0")
|
inspect(logger.file_open_failures(), content="0")
|
||||||
inspect(logger.file_write_failures(), content="0")
|
inspect(logger.file_write_failures(), content="0")
|
||||||
|
|||||||
@@ -277,10 +277,10 @@ test "file sink reopen and failure counters reflect backend state" {
|
|||||||
inspect(sink.reopen_truncate(), content="false")
|
inspect(sink.reopen_truncate(), content="false")
|
||||||
inspect(sink.append_mode(), content="false")
|
inspect(sink.append_mode(), content="false")
|
||||||
inspect(sink.reopen_with_current_policy(), content="false")
|
inspect(sink.reopen_with_current_policy(), content="false")
|
||||||
inspect(sink.open_failures(), content="3")
|
inspect(sink.open_failures(), content="4")
|
||||||
inspect(sink.reopen_append(), content="false")
|
inspect(sink.reopen_append(), content="false")
|
||||||
inspect(sink.append_mode(), content="true")
|
inspect(sink.append_mode(), content="true")
|
||||||
inspect(sink.open_failures(), content="4")
|
inspect(sink.open_failures(), content="5")
|
||||||
sink.reset_failure_counters()
|
sink.reset_failure_counters()
|
||||||
inspect(sink.open_failures(), content="0")
|
inspect(sink.open_failures(), content="0")
|
||||||
inspect(sink.write_failures(), content="0")
|
inspect(sink.write_failures(), content="0")
|
||||||
|
|||||||
Reference in New Issue
Block a user