Skip to content

Commit

Permalink
add flake8 static tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ernstleierzopf committed Mar 25, 2024
1 parent 10c6bac commit 63365da
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ pipeline {
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runBandit"
}
}
stage("Flake8"){
steps {
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runFlake8"
}
}
stage("Release String Check"){
steps {
sh "docker run -m=2G --rm aecid/logdata-anomaly-miner-testing:$JOB_BASE_NAME-$EXECUTOR_NUMBER-$BUILD_ID runReleaseStringCheck"
Expand Down
4 changes: 2 additions & 2 deletions aecid-testsuite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN apt-get update && apt-get install -y \
python3-pandas \
python3-patsy \
python3-defusedxml \
python3-bandit
python3-bandit \
libacl1-dev \
postfix \
procps \
Expand Down Expand Up @@ -136,7 +136,7 @@ ADD scripts/testingwrapper.sh /testingwrapper.sh
ADD source /home/aminer/source
ADD docs /home/aminer/docs

RUN pip3 install orjson
RUN pip3 install orjson flake8 pycodestyle
RUN PACK=$(find /usr/local/lib/ -name orjson.cpython\*.so) && FILE=$(echo $PACK | awk -F '/' '{print $NF}') ln -s $PACK /usr/lib/logdata-anomaly-miner/$FILE

USER aminer
Expand Down
2 changes: 2 additions & 0 deletions aecid-testsuite/runFlake8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 -m flake8 --max-line-length=140 --exclude=aecid-testsuite/ /usr/lib/logdata-anomaly-miner
exit $?
8 changes: 7 additions & 1 deletion scripts/testingwrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ case "$1" in
./${1}.sh ${*:2}
exit $?
;;
runFlake8)
cd $TESTDIR
./${1}.sh ${*:2}
exit $?
;;
runConfAvailableTest)
cd $TESTDIR
./${1}.sh ${*:2}
Expand All @@ -119,6 +124,7 @@ case "$1" in
cd $TESTDIR
./runMypy.sh
./runBandit.sh
./runFlake8.sh
./runReleaseStringCheck.sh
./runSuspendModeTest.sh
./runUnittests.sh
Expand Down Expand Up @@ -159,7 +165,7 @@ case "$1" in
echo " runAminerXmlInputDemo | runAminerIntegrationTest | runOfflineMode | runCoverageTests | runRemoteControlTest"
echo " runTryItOut | runGettingStarted | runHowToCreateYourOwnSequenceDetector | runHowToCreateYourOwnFrequencyDetector"
echo " runHowToMissingMatchPathValueDetector | runHowToEntropyDetector | runAminerEncodingDemo | runMypy | runBandit"
echo " runConfAvailableTest | runReleaseStringCheck ] <options>"
echo " runFlake8 | runConfAvailableTest | runReleaseStringCheck ] <options>"
exit 1
;;

Expand Down

0 comments on commit 63365da

Please sign in to comment.