Skip to content

Commit

Permalink
feat: added unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus committed Dec 8, 2024
1 parent 1746923 commit 158df81
Show file tree
Hide file tree
Showing 8 changed files with 311 additions and 85 deletions.
68 changes: 33 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ crossbeam-channel = "0"
crossbeam-queue = "0"
crossbeam-utils = "0"
deko = "0"
derive_deref = "1"
derive_more = {version="1", features = ["deref", "from"]}
dirs = "5"
dirs-sys = "0"
encstr = { path = "./crate/encstr" }
Expand Down
15 changes: 6 additions & 9 deletions build/ci/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ function clean() {
function test() {
cargo test --tests --workspace
cargo build
${MAIN_EXECUTABLE:?} > /dev/null
${MAIN_EXECUTABLE:?} --config= > /dev/null
${MAIN_EXECUTABLE:?} --config= --help > /dev/null
${MAIN_EXECUTABLE:?} --config=etc/defaults/config-k8s.yaml > /dev/null
${MAIN_EXECUTABLE:?} --config=etc/defaults/config-ecs.yaml > /dev/null
${MAIN_EXECUTABLE:?} --shell-completions bash > /dev/null
${MAIN_EXECUTABLE:?} --man-page > /dev/null
${MAIN_EXECUTABLE:?} --list-themes > /dev/null
echo "" | ${MAIN_EXECUTABLE:?} --concurrency 4 > /dev/null
if ${MAIN_EXECUTABLE:?} -s test.log.gz 2>/dev/null > /dev/null; then
echo "Expected combination of options `-s 1234.log.gz` to fail"
exit 1
fi
${MAIN_EXECUTABLE:?} --config= --shell-completions bash > /dev/null
${MAIN_EXECUTABLE:?} --config= --man-page > /dev/null
${MAIN_EXECUTABLE:?} --config= --list-themes > /dev/null
${MAIN_EXECUTABLE:?} --config= sample/prometheus.log -P > /dev/null
echo "" | ${MAIN_EXECUTABLE:?} --config= --concurrency 4 > /dev/null
}

function merge() {
Expand Down
1 change: 1 addition & 0 deletions sample/test.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ts":"2024-10-01T01:02:03Z","level":"info","msg":"some test message"}
Loading

0 comments on commit 158df81

Please sign in to comment.