Skip to content

Commit

Permalink
Merge pull request #5 from fledge-iot/2.0.1RC
Browse files Browse the repository at this point in the history
2.0.1RC
  • Loading branch information
dianomicbot authored Oct 27, 2022
2 parents 8aa4ff0 + 1cd98ec commit b6a01c5
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 5 deletions.
62 changes: 62 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
timestamps {
node("ubuntu18-agent") {
catchError {
checkout scm
dir_exists = sh (
script: "test -d 'tests' && echo 'Y' || echo 'N' ",
returnStdout: true
).trim()

if (dir_exists == 'N'){
currentBuild.result= 'FAILURE'
echo "No tests directory found! Exiting."
return
}

try {
stage("Prerequisites"){
// Change to corresponding CORE_BRANCH as required
// e.g. FOGL-xxxx, main etc.
sh '''
CORE_BRANCH='develop'
${HOME}/buildFledge ${CORE_BRANCH} ${WORKSPACE}
'''
}
} catch (e) {
currentBuild.result = 'FAILURE'
echo "Failed to build Fledge; required to run the tests!"
return
}

try {
stage("Run Tests"){
echo "Executing tests..."
sh '''
. ${WORKSPACE}/PLUGIN_PR_ENV/bin/activate
export FLEDGE_ROOT=$HOME/fledge && export PYTHONPATH=$HOME/fledge/python
cd tests && python3 -m pytest -vv --ignore=system --ignore=api --junit-xml=test_result.xml
'''
echo "Done."
}
} catch (e) {
result = "TESTS FAILED"
currentBuild.result = 'FAILURE'
echo "Tests failed!"
}

try {
stage("Publish Test Report"){
junit "tests/test_result.xml"
}
} catch (e) {
result = "TEST REPORT GENERATION FAILED"
currentBuild.result = 'FAILURE'
echo "Failed to generate test reports!"
}
}
stage ("Cleanup"){
// Add here if any cleanup is required
echo "Done."
}
}
}
2 changes: 1 addition & 1 deletion VERSION.north.s7_python
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fledge_north_s7_python_version=2.0.0
fledge_north_s7_python_version=2.0.1
fledge_version>=2.0
2 changes: 1 addition & 1 deletion python/fledge/plugins/north/s7_python/s7_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
def plugin_info():
return {
'name': 's7_north_python',
'version': '2.0.0',
'version': '2.0.1',
'type': 'north',
'interface': '1.0',
'config': _DEFAULT_CONFIG
Expand Down
2 changes: 1 addition & 1 deletion requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ elif apt --version 2>/dev/null; then
sudo apt install -y wget
sudo apt install -y p7zip
wget --content-disposition -c https://sourceforge.net/projects/snap7/files/1.4.2/snap7-full-1.4.2.7z/download
p7zip -d snap7-full-1.4.2.7z
echo "A" |p7zip -d snap7-full-1.4.2.7z
cd snap7-full-1.4.2/build/unix
make -f "$(uname -m)_linux.mk" install
else
Expand Down
Empty file added tests/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions tests/test_north_s7_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import logging

from unittest.mock import patch, MagicMock, ANY
from fledge.plugins.north.s7_python import s7_python as s7
from python.fledge.plugins.north.s7_python import s7_python as s7


import asyncio
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_plugin_info(self):

assert plugin_info == {
'name': 's7_north_python',
'version': '2.0.0',
'version': '2.0.1',
'type': 'north',
'interface': '1.0',
'config': s7._DEFAULT_CONFIG
Expand Down

0 comments on commit b6a01c5

Please sign in to comment.