diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b8dd4d0..e7ac5bd 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -51,6 +51,78 @@ jobs: path: target/release/czkawka_cli if: ${{ matrix.type == 'release' }} +# Duplicate finder checks included and excluded directories +# Others are just check delete files number + - name: Linux Regression Test + run: | + wget https://github.com/qarmin/czkawka/releases/download/1.1.0/TestSuite.zip + unzip TestSuite.zip -d TestSuite + python3 misc/check_results.py TestSuite 15 8 + + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen + python3 misc/check_results.py TestSuite 7 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen + python3 misc/check_results.py TestSuite 7 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo + python3 misc/check_results.py TestSuite 14 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo + python3 misc/check_results.py TestSuite 13 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -m 1500 -D aeo + python3 misc/check_results.py TestSuite 8 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R + python3 misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo + python3 misc/check_results.py TestSuite 13 8 + + + target/release/czkawka_cli big -d "$(pwd)/TestSuite" + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" + python3 misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" -D + python3 misc/check_results.py TestSuite 13 8 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" + python3 misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" -D + python3 misc/check_results.py TestSuite 15 2 + + rm -rf TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli temp -d "$(pwd)/TestSuite" + python3 misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli temp -d "$(pwd)/TestSuite" -D + python3 misc/check_results.py TestSuite 14 8 + if: ${{ matrix.type == 'release' }} + linux-gui: strategy: matrix: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 44cc91d..3cc60db 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + - uses: actions-rs/toolchain@v1 with: toolchain: ${{ matrix.toolchain }} @@ -48,6 +50,101 @@ jobs: path: target/release/czkawka_cli.exe if: ${{ matrix.type == 'release' }} +# Duplicate finder checks included and excluded directories +# Others are just check delete files number +# Windows build have some elements changed like powershell before wget and unzip, python instead python3, rm -r instead rm -r and one (at the top) additional test which check size of characyers + - name: test + run: | + powershell wget https://github.com/qarmin/czkawka/releases/download/1.1.0/TestSuite.zip -O TestSuite.zip + powershell unzip TestSuite.zip -d TestSuite + python misc/check_results.py TestSuite 15 8 + + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)\testsuite" -e "$(pwd)/TestSuite/subFolder" -D aeo + python misc/check_results.py TestSuite 13 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" "$(pwd)/teStSuite" -D aen + python misc/check_results.py TestSuite 7 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)\TestSuite" "$(pwd)/TESTSUITE" -D aen + python misc/check_results.py TestSuite 7 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + + + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen + python misc/check_results.py TestSuite 7 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -D aen + python misc/check_results.py TestSuite 7 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -x TEXT -D aeo + python misc/check_results.py TestSuite 14 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -e "$(pwd)/TestSuite/SubFolder" -D aeo + python misc/check_results.py TestSuite 13 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -m 1500 -D aeo + python misc/check_results.py TestSuite 8 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R + python misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli dup -d "$(pwd)/TestSuite" -R -D aeo + python misc/check_results.py TestSuite 13 8 + + + target/release/czkawka_cli big -d "$(pwd)/TestSuite" + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" + python misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli empty-files -d "$(pwd)/TestSuite" -D + python misc/check_results.py TestSuite 13 8 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" + python misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli empty-folders -d "$(pwd)/TestSuite" -D + python misc/check_results.py TestSuite 15 2 + + rm -r TestSuite + unzip TestSuite.zip -d TestSuite + + target/release/czkawka_cli temp -d "$(pwd)/TestSuite" + python misc/check_results.py TestSuite 15 8 + target/release/czkawka_cli temp -d "$(pwd)/TestSuite" -D + python misc/check_results.py TestSuite 14 8 + if: ${{ matrix.type == 'release' }} + + windows-gui-orbtk: strategy: matrix: diff --git a/.gitignore b/.gitignore index 7ea5a4a..c9204a8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ *~ *# results*.txt +TestSuite* \ No newline at end of file diff --git a/Changelog.md b/Changelog.md index 2aa1cde..58ba89c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,9 @@ -## Version 1.1 - 10.10.2020r +## Version 1.1.1 - +- Add test suite to PR + + + +## Version 1.1.0 - 10.10.2020r - Windows support [#58](https://github.com/qarmin/czkawka/pull/58) - Improve code quality/Simplify codebase [#52](https://github.com/qarmin/czkawka/pull/52) - Fixed skipping some correct results in specific situations [#52](https://github.com/qarmin/czkawka/pull/52#discussion_r502613895) diff --git a/misc/check_results.py b/misc/check_results.py new file mode 100644 index 0000000..3127c67 --- /dev/null +++ b/misc/check_results.py @@ -0,0 +1,23 @@ +import os +import sys + +if len(sys.argv) != 4: + print("ERROR: Not provided 3 recuired arguments - " + str(sys.argv)) + exit(1) + +folder_name = sys.argv[1] +files_recuired = sys.argv[2] +directories_recuired = sys.argv[3] + +file_count = sum(len(files) for _, _, files in os.walk(folder_name)) +if str(file_count) != files_recuired: + print("Current files: " + str(file_count) + ", but recuired is: " + str(files_recuired)) + print("This commit probably introduced regression, please recheck it.") + exit(1) + +directory_count = sum(len(dire) for _, dire, files in os.walk(folder_name)) +if str(directory_count) != directories_recuired: + print("Current directories: " + str(directory_count) + ", but recuired is: " + str(directories_recuired)) + print("This commit probably introduced regression, please recheck it.") + exit(1) +