Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(euclidean_cluster): add unit tests #7735

Conversation

badai-nguyen
Copy link
Contributor

Description

  • To add unit tests for cluster function of VoxelGridBasedEuclideanCluster

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@github-actions github-actions bot added the component:perception Advanced sensor data processing and environment understanding. (auto-assigned) label Jun 27, 2024
Copy link

github-actions bot commented Jun 27, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@badai-nguyen badai-nguyen requested a review from YoshiRi July 1, 2024 23:34
@badai-nguyen badai-nguyen marked this pull request as ready for review July 1, 2024 23:34
@badai-nguyen badai-nguyen requested a review from yukkysaito as a code owner July 1, 2024 23:34
@badai-nguyen badai-nguyen added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 2, 2024

// Test case 3: Test case when the input pointcloud has two clusters with points number greater to
// max_cluster_size
TEST(VoxelGridBasedEuclideanClusterTest, testcase3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failed.

1: /home/yoshiri/autoware/src/universe/autoware.universe/perception/euclidean_cluster/test/test_voxel_grid_based_euclidean_cluster.cpp:165: Failure
1: Expected equality of these values:
1:   output.feature_objects.size()
1:     Which is: 1
1:   0
1: [  FAILED  ] VoxelGridBasedEuclideanClusterTest.testcase3 (0 ms)
1: [----------] 3 tests from VoxelGridBasedEuclideanClusterTest (3 ms total)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I found test passed

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 91.02564% with 7 lines in your changes missing coverage. Please review.

Project coverage is 28.37%. Comparing base (a39cfb7) to head (2d21e9b).
Report is 17 commits behind head on main.

Files Patch % Lines
...r/test/test_voxel_grid_based_euclidean_cluster.cpp 91.02% 0 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7735      +/-   ##
==========================================
- Coverage   28.75%   28.37%   -0.39%     
==========================================
  Files        1594     1619      +25     
  Lines      116892   115824    -1068     
  Branches    50050    49220     -830     
==========================================
- Hits        33616    32865     -751     
+ Misses      74178    73956     -222     
+ Partials     9098     9003      -95     
Flag Coverage Δ *Carryforward flag
differential 6.31% <91.02%> (?)
total 28.42% <ø> (-0.34%) ⬇️ Carriedforward from bfe1728

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
@YoshiRi YoshiRi changed the title chore(euclidean_cluster): add unit tests test(euclidean_cluster): add unit tests Jul 3, 2024
@badai-nguyen
Copy link
Contributor Author

@YoshiRi I updated branch and all tests were passed. Could you review this again?

test 1
    Start 1: test_voxel_grid_based_euclidean_cluster_fusion

1: Test command: /usr/bin/python3.10 "-u" "/__w/autoware.universe/autoware.universe/install/ament_cmake_test/share/ament_cmake_test/cmake/run_test.py" "/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_results/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion.gtest.xml" "--package-name" "euclidean_cluster" "--output-file" "/__w/autoware.universe/autoware.universe/build/euclidean_cluster/ament_cmake_gtest/test_voxel_grid_based_euclidean_cluster_fusion.txt" "--command" "/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion" "--gtest_output=xml:/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_results/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion.gtest.xml"
1: Test timeout computed to be: 60
1: -- run_test.py: invoking following command in '/__w/autoware.universe/autoware.universe/build/euclidean_cluster':
1:  - /__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion --gtest_output=xml:/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_results/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion.gtest.xml
1: [==========] Running 3 tests from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 3 tests from VoxelGridBasedEuclideanClusterTest
1: [ RUN      ] VoxelGridBasedEuclideanClusterTest.testcase1
1: cluster success
1: number of output clusters 1
1: number points of first cluster: 100
1: [       OK ] VoxelGridBasedEuclideanClusterTest.testcase1 (0 ms)
1: [ RUN      ] VoxelGridBasedEuclideanClusterTest.testcase2
1: cluster success
1: number of output clusters 0
1: [       OK ] VoxelGridBasedEuclideanClusterTest.testcase2 (0 ms)
1: [ RUN      ] VoxelGridBasedEuclideanClusterTest.testcase3
1: cluster success
1: number of output clusters 0
1: [       OK ] VoxelGridBasedEuclideanClusterTest.testcase3 (0 ms)
1: [----------] 3 tests from VoxelGridBasedEuclideanClusterTest (0 ms total)
1: 
1: [----------] Global test environment tear-down
1: [==========] 3 tests from 1 test suite ran. (0 ms total)
1: [  PASSED  ] 3 tests.
1: -- run_test.py: return code 0
1: -- run_test.py: inject classname prefix into gtest result file '/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_results/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion.gtest.xml'
1: -- run_test.py: verify result file '/__w/autoware.universe/autoware.universe/build/euclidean_cluster/test_results/euclidean_cluster/test_voxel_grid_based_euclidean_cluster_fusion.gtest.xml'
1/5 Test #1: test_voxel_grid_based_euclidean_cluster_fusion ...   Passed    0.10 sec
100% tests passed, 0 tests failed out of 5

Label Time Summary:
copyright     =   0.57 sec*proc (1 test)
cppcheck      =   0.16 sec*proc (1 test)
gtest         =   0.10 sec*proc (1 test)
lint_cmake    =   0.14 sec*proc (1 test)
linter        =   1.21 sec*proc (4 tests)
xmllint       =   0.33 sec*proc (1 test)

Total Test time (real) =   1.31 sec

Copy link
Contributor

@YoshiRi YoshiRi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@badai-nguyen badai-nguyen merged commit 4cec645 into autowarefoundation:main Jul 10, 2024
30 checks passed
Ariiees pushed a commit to Ariiees/autoware.universe that referenced this pull request Jul 22, 2024
* chore(euclidean_cluster): add unit tests

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: pre-commit

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

* fix: namespace update

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>

---------

Signed-off-by: badai-nguyen <dai.nguyen@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants