Skip to content

Commit

Permalink
Merge pull request #325 from rdkcentral/master
Browse files Browse the repository at this point in the history
Dobby Patch Release v3.10.1
  • Loading branch information
goruklu committed Apr 9, 2024
2 parents f6318aa + f2f3233 commit 4a998b6
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/L1-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
run: |
sudo apt-get update -y -q
sudo apt-get install -q -y automake libtool autotools-dev software-properties-common build-essential cmake libsystemd-dev libctemplate-dev libjsoncpp-dev libdbus-1-dev libnl-3-dev libnl-route-3-dev libsystemd-dev libyajl-dev libcap-dev libboost-dev lcov clang valgrind
sudo pip3 install xmltodict
sudo pip3 install requests
- name: Set clang toolchain
if: ${{ matrix.compiler == 'clang' }}
Expand Down Expand Up @@ -71,9 +73,9 @@ jobs:
- name: run l1-tests
if: ${{ matrix.extra_flags == 'RUN_TESTS' && matrix.build_type == 'Debug' }}
run: |
sudo valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyTest/DobbyL1Test
sudo $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyUtilsTest/DobbyUtilsL1Test
sudo valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyManagerTest/DobbyManagerL1Test
sudo valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyTest/DobbyL1Test --gtest_output="json:$(pwd)/DobbyL1TestResults.json"
sudo $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyUtilsTest/DobbyUtilsL1Test --gtest_output="json:$(pwd)/DobbyUtilsL1TestResults.json"
sudo valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try $GITHUB_WORKSPACE/build/tests/L1_testing/tests/DobbyManagerTest/DobbyManagerL1Test --gtest_output="json:$(pwd)/DobbyManagerL1TestResults.json"
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' && matrix.extra_flags == 'RUN_TESTS' && matrix.build_type == 'Debug' }}
Expand All @@ -100,5 +102,8 @@ jobs:
with:
name: artifacts
path: |
DobbyL1TestResults.json
DobbyUtilsL1TestResults.json
DobbyManagerL1TestResults.json
coverage
if-no-files-found: warn
3 changes: 2 additions & 1 deletion .github/workflows/L2-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ jobs:
working-directory: Dobby/tests/L2_testing/test_runner/
run: |
python3 runner.py -p 3 -v 5
cp $GITHUB_WORKSPACE/Dobby/tests/L2_testing/test_runner/DobbyL2TestResults.json $GITHUB_WORKSPACE
- name: Generate coverage
if: ${{ matrix.coverage == 'with-coverage' }}
Expand All @@ -244,6 +245,6 @@ jobs:
with:
name: artifacts
path: |
DobbyL2TestResults.json
l2coverage
if-no-files-found: warn

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ cmake_minimum_required( VERSION 3.7.0 )
include(GNUInstallDirs)

# Project setup
project( Dobby VERSION "3.10.0" )
project( Dobby VERSION "3.10.1" )


# Set the major and minor version numbers of dobby (also used by plugins)
set( DOBBY_MAJOR_VERSION 3 )
set( DOBBY_MINOR_VERSION 10 )
set( DOBBY_MICRO_VERSION 0 )
set( DOBBY_MICRO_VERSION 1 )

set(INSTALL_CMAKE_DIR lib/cmake/Dobby)

Expand Down
2 changes: 1 addition & 1 deletion rdkPlugins/Storage/source/DynamicMountDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ bool DynamicMountDetails::onPostStop() const

if (stat(targetPath.c_str(), &buffer) == 0)
{
if (remove(targetPath.c_str()) == 0)
if (umount(targetPath.c_str()) == 0)
{
success = true;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/L2_testing/dobby_specs/wget-private.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"cwd": "/",
"args": [
"wget",
"--timeout=5",
"--timeout=4",
"example.com"
],
"env": [
Expand Down
18 changes: 18 additions & 0 deletions tests/L2_testing/test_runner/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import pid_limit_tests
import memcr_tests
import sys
import json

from time import sleep

Expand All @@ -47,6 +48,9 @@ def run_all_tests():
success_count = 0
total_count = 0
tested_groups_count = 0
testsuites_info = []
all_test_report = {}

for test in supported_tests:
test_utils.print_log("\nExecuting test Test Group: \"%s\"" % test.__name__, test_utils.Severity.info)
if (test_utils.selected_platform == test_utils.Platforms.vagrant_vm ) and (test.__name__ == "gui_containers"):
Expand All @@ -61,12 +65,26 @@ def run_all_tests():
test_utils.print_log("Total Passed Tests: %d " % success, test_utils.Severity.info)
success_count += success
total_count += total
testsuites_info.append({"name":test.__name__,"tests":total,"Passed Tests":success,"Failed Tests":total - success})
with open('test_results.json', 'r') as json_file:
current_test_result = json.load(json_file)
testsuites_info[tested_groups_count]['testsuite'] = []
testsuites_info[tested_groups_count]["testsuite"].append(current_test_result)
if total > 0:
tested_groups_count += 1
sleep(1)

test_utils.print_log("\n\nSummary:", test_utils.Severity.info)
skipped_test_count = len(supported_tests) - tested_groups_count
json_file_path = 'DobbyL2TestResults.json'
all_test_report["Total tests"] = total_count
all_test_report["Passed tests"] = success_count
all_test_report["Failed Tests"] = total_count - success_count
all_test_report["Skipped testsuites"] = skipped_test_count
all_test_report["testsuites"] = []
all_test_report["testsuites"].append(testsuites_info)
with open(json_file_path, 'w') as json_file:
json.dump(all_test_report, json_file, indent=2)
if skipped_test_count:
test_utils.print_log("Skipped %d test groups" % skipped_test_count, test_utils.Severity.info)
test_utils.print_log("Tested %d test groups" % tested_groups_count, test_utils.Severity.info)
Expand Down
10 changes: 10 additions & 0 deletions tests/L2_testing/test_runner/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from enum import IntEnum
from collections import namedtuple
from argparse import ArgumentParser
import json

Test = namedtuple('Test', ['name',
'container_id',
Expand Down Expand Up @@ -205,6 +206,15 @@ def count_print_results(output_table):
"""

success_count, test_count = count_successes(output_table)

# Convert named tuples to dictionaries
test_results_dict_list = [{key: value for key, value in result._asdict().items() if key != 'container_log_file'} for result in output_table]

# Save the data to a JSON file
json_file_path = 'test_results.json'
with open(json_file_path, 'w') as json_file:
json.dump(test_results_dict_list, json_file, indent=2)

return print_results(success_count, test_count)


Expand Down

0 comments on commit 4a998b6

Please sign in to comment.