From e401c14960d9f2a85fdb3a38e27dc55676e16d77 Mon Sep 17 00:00:00 2001 From: Lifailon Date: Fri, 12 Sep 2025 14:51:53 +0300 Subject: [PATCH] fix logging for tests --- .github/workflows/build.yml | 15 ++++++++------- .gitignore | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f32d21..8c67844 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -136,9 +136,9 @@ jobs: - name: Unit testing (all functions and mock interface) in Linux if: ${{ github.event.inputs.Test == 'true' && github.event.inputs.Distro != 'macos-15' && github.event.inputs.Distro != 'windows-2022' }} run: | - output=$(sudo env "PATH=$PATH" go test -v -cover | tee /dev/tty) + output=$(sudo env "PATH=$PATH" go test -v -cover | tee test.log) echo "## 🧪 Test Coverage" >> $GITHUB_STEP_SUMMARY - echo "$output" | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY + cat test.log | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY continue-on-error: true timeout-minutes: 10 @@ -166,9 +166,9 @@ jobs: - name: Unit testing (files, flags, cli and run main interface) in macOS if: ${{ github.event.inputs.Test == 'true' && github.event.inputs.Distro == 'macos-15' }} run: | - output=$(sudo go test -v -cover --run "TestUnixFiles|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface" | tee /dev/tty) + output=$(sudo go test -v -cover --run "TestUnixFiles|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface" | tee test.log) echo "## 🧪 Test Coverage" >> $GITHUB_STEP_SUMMARY - echo "$output" | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY + cat test.log | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY continue-on-error: true timeout-minutes: 5 @@ -189,9 +189,9 @@ jobs: - name: Unit testing (events, files, flags, cli, main and mock interface) in Windows if: ${{ github.event.inputs.Test == 'true' && github.event.inputs.Distro == 'windows-2022' }} run: | - output=$(go test -v -cover --run "TestWin.*|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface|TestMockInterface" | tee /dev/tty) + output=$(go test -v -cover --run "TestWin.*|TestFlags|TestCommandColor|TestCommandFuzzyFilter|TestCommandRegexFilter|TestMainInterface|TestMockInterface" | tee test.log) echo "## 🧪 Test Coverage" >> $GITHUB_STEP_SUMMARY - echo "$output" | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY + cat test.log | tail -n 2 | head -n 1 | sed "s/coverage: //" | sed -E "s/of.+//g" >> $GITHUB_STEP_SUMMARY shell: bash continue-on-error: true timeout-minutes: 5 @@ -291,7 +291,7 @@ jobs: - name: Build binaries if: ${{ github.event.inputs.Binary == 'true' }} run: | - version=$VERSION + version=$VERSION mkdir -p bin architectures=("amd64" "arm64") oss=("linux" "darwin" "openbsd" "freebsd" "windows") @@ -310,6 +310,7 @@ jobs: - name: Build deb package if: ${{ github.event.inputs.Binary == 'true' }} run: | + version=$VERSION rm -f lazyjournal mkdir -p lazyjournal/DEBIAN lazyjournal/usr/local/bin architectures=("amd64" "arm64") diff --git a/.gitignore b/.gitignore index 9a38ebd..0f42909 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ lazyjournal # Test reports *report.md -*.out \ No newline at end of file +*.out +test.log \ No newline at end of file