Skip to content

Commit 85718d7

Browse files
authored
Merge pull request #42 from fledge-iot/2.1.0RC
2.1.0RC
2 parents de897ba + f2db685 commit 85718d7

6 files changed

Lines changed: 69 additions & 4 deletions

File tree

Jenkinsfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
timestamps {
2+
node("ubuntu18-agent") {
3+
catchError {
4+
checkout scm
5+
dir_exists = sh (
6+
script: "test -d 'tests' && echo 'Y' || echo 'N' ",
7+
returnStdout: true
8+
).trim()
9+
10+
if (dir_exists == 'N'){
11+
currentBuild.result= 'FAILURE'
12+
echo "No tests directory found! Exiting."
13+
return
14+
}
15+
try {
16+
stage("Prerequisites"){
17+
// Change to corresponding CORE_BRANCH as required
18+
// e.g. FOGL-xxxx, main etc.
19+
sh '''
20+
CORE_BRANCH='develop'
21+
${HOME}/buildFledge ${CORE_BRANCH} ${WORKSPACE}
22+
'''
23+
}
24+
} catch (e) {
25+
currentBuild.result = 'FAILURE'
26+
echo "Failed to build Fledge; required to run the tests!"
27+
return
28+
}
29+
30+
try {
31+
stage("Run Tests"){
32+
echo "Executing tests..."
33+
sh '''
34+
export FLEDGE_ROOT=$HOME/fledge
35+
cd tests && cmake . && make && ./RunTests --gtest_output=xml:test_output.xml
36+
'''
37+
echo "Done."
38+
}
39+
} catch (e) {
40+
result = "TESTS FAILED"
41+
currentBuild.result = 'FAILURE'
42+
echo "Tests failed!"
43+
}
44+
45+
try {
46+
stage("Publish Test Report"){
47+
junit "tests/test_output.xml"
48+
}
49+
} catch (e) {
50+
result = "TEST REPORT GENERATION FAILED"
51+
currentBuild.result = 'FAILURE'
52+
echo "Failed to generate test reports!"
53+
}
54+
}
55+
56+
stage ("Cleanup"){
57+
// Add here if any cleanup is required
58+
echo "Done."
59+
}
60+
}
61+
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.1
1+
2.1.0

fledge.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fledge_version>=2.0
1+
fledge_version>=2.1

include/python35.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class Python35Filter : public FledgeFilter
5959
getFiltersPath() const { return m_filtersPath; };
6060
bool setScriptName();
6161
bool configure();
62+
bool initSuccess() { return m_init; }
6263
bool reconfigure(const std::string& newConfig);
6364
void lock() { m_configMutex.lock(); };
6465
void unlock() { m_configMutex.unlock(); };

tests/test_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ TEST(EXPRESSION_INFO, PluginInfo)
1515
{
1616
PLUGIN_INFORMATION *info = plugin_info();
1717
ASSERT_STREQ(info->name, "python35");
18-
ASSERT_EQ(info->type, PLUGIN_TYPE_FILTER);
18+
ASSERT_STREQ(info->type, PLUGIN_TYPE_FILTER);
1919
}
2020

2121
TEST(EXPRESSION_INFO, PluginInfoConfigParse)

tests/test_python35.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <rapidjson/document.h>
1010
#include <reading.h>
1111
#include <reading_set.h>
12+
#include <python35.h>
1213

1314
using namespace std;
1415
using namespace rapidjson;
@@ -291,7 +292,9 @@ TEST(PYTHON35, IndentError)
291292
config->setValue("enable", "true");
292293
ReadingSet *outReadings;
293294
void *handle = plugin_init(config, &outReadings, Handler);
294-
ASSERT_EQ(handle, (void *)NULL);
295+
Python35Filter *hndl = (Python35Filter *) handle;
296+
// handle is valid but it has not been configured/init properly/completely because of indent error in python script
297+
ASSERT_FALSE(hndl && hndl->initSuccess());
295298
}
296299

297300
#if 0

0 commit comments

Comments
 (0)