Add test project to automatically find regressions (#65)
This commit is contained in:
parent
a4b0b12c30
commit
46af0c0ea2
72
.github/workflows/linux.yml
vendored
72
.github/workflows/linux.yml
vendored
|
@ -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:
|
||||
|
|
97
.github/workflows/windows.yml
vendored
97
.github/workflows/windows.yml
vendored
|
@ -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:
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@
|
|||
*~
|
||||
*#
|
||||
results*.txt
|
||||
TestSuite*
|
|
@ -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)
|
||||
|
|
23
misc/check_results.py
Normal file
23
misc/check_results.py
Normal file
|
@ -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)
|
||||
|
Loading…
Reference in a new issue