Skip to content

G-API: Adding a skip for failed streaming tests#18819

Merged
alalek merged 5 commits intoopencv:masterfrom
mpashchenkov:mp/ocv-gapi-skip-centos-tests
Nov 17, 2020
Merged

G-API: Adding a skip for failed streaming tests#18819
alalek merged 5 commits intoopencv:masterfrom
mpashchenkov:mp/ocv-gapi-skip-centos-tests

Conversation

@mpashchenkov
Copy link
Copy Markdown
Contributor

@mpashchenkov mpashchenkov commented Nov 16, 2020

Added a skip for failed streaming tests

Tests failed for standalone centOs build.

Case:

try {
    setSource(make_src(dataPath))
} catch(...) {
    skipTest("Warning!")
}

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Magic centos commands:

force_builders=Custom
build_image:Custom=centos:7
buildworker:Custom=linux-1
build_gapi_standalone:Custom=ade-0.1.1f

build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f

@@ -35,7 +35,6 @@ void initTestDataPath()
// Since G-API has no own test data (yet), it is taken from the common space
const char* testDataPath = getenv("OPENCV_TEST_DATA_PATH");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OPENCV_TEST_DATA_PATH

Do we really need that?
It is already handled by ts module (OpenCV testing framework)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't know. Can I get an example or a file where this is used?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I looked at the ts.hpp. And findDataFile(call findData) do this step. But i don't understand, how i can to get around addDataSearchPath(...). I can remove initTestDataPath in this case.

}

struct GAPI_Streaming: public ::testing::TestWithParam<KernelPackage> {
GAPI_Streaming() { initTestDataPath(); }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is it copied into tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because i get segfault on my local pc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Assertion failed) testDataPath != nullptr in function 'initTestDataPath'
" thrown in the test fixture's constructor.
Segmentation fault (core dumped)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Segfault is here because nobody catched exception.
Need to remove GAPI_Assert(testDataPath != nullptr); line from implementation and make this env variable optional (it make sense to left stdout message).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Returned.

GAPI_Assert(testDataPath != nullptr);

cvtest::addDataSearchPath(testDataPath);
cvtest::addDataSearchPath("OPENCV_TEST_DATA_PATH");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wrong change.

environment variable's name != path

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know. It is my mistake.

@mpashchenkov mpashchenkov force-pushed the mp/ocv-gapi-skip-centos-tests branch from 15a8851 to 419f101 Compare November 17, 2020 08:49
try {
ccomp.setSource(gapi::wip::make_src<cv::gapi::wip::GCaptureSource>
(findDataFile("cv/video/768x576.avi")));
} catch(...) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please extract findDataFile() call out of this catch "anything" statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed for all.

const char* testDataPath = getenv("OPENCV_TEST_DATA_PATH");
GAPI_Assert(testDataPath != nullptr);

cvtest::addDataSearchPath(testDataPath);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assertions are usually used to check assumptions of the code below.

So with removal of assertion you must check/fix the code below:

if (testDataPath)
    cvtest::addDataSearchPath(testDataPath);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

LGTM

@alalek alalek merged commit 94e8a08 into opencv:master Nov 17, 2020
@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 19, 2020

BTW, There are 3 cases left to make green the module tests:

[ RUN      ] GraphMeta.Streaming_AccessInput
unknown file: Failure
C++ exception with description "OpenCV(4.5.1-pre) /build/precommit_custom_linux/opencv/modules/gapi/include/opencv2/gapi/streaming/cap.hpp:70: error: (-215:Assertion failed) false && "Couldn't grab the very first frame" in function 'prep'
" thrown in the test body.
[  FAILED  ] GraphMeta.Streaming_AccessInput (0 ms)
[ RUN      ] GraphMeta.Streaming_AccessOutput
unknown file: Failure
C++ exception with description "OpenCV(4.5.1-pre) /build/precommit_custom_linux/opencv/modules/gapi/include/opencv2/gapi/streaming/cap.hpp:70: error: (-215:Assertion failed) false && "Couldn't grab the very first frame" in function 'prep'
" thrown in the test body.
[  FAILED  ] GraphMeta.Streaming_AccessOutput (1 ms)
[ RUN      ] GraphMeta.Streaming_AccessDesync
unknown file: Failure
C++ exception with description "OpenCV(4.5.1-pre) /build/precommit_custom_linux/opencv/modules/gapi/include/opencv2/gapi/streaming/cap.hpp:70: error: (-215:Assertion failed) false && "Couldn't grab the very first frame" in function 'prep'
" thrown in the test body.
[  FAILED  ] GraphMeta.Streaming_AccessDesync (1 ms)

@mpashchenkov
Copy link
Copy Markdown
Contributor Author

Yes, these tests appeared after merge.

@alalek alalek mentioned this pull request Nov 27, 2020
@alalek alalek mentioned this pull request Apr 2, 2021
4 tasks
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…ntos-tests

G-API: Adding a skip for failed streaming tests

* Skip tests

* Pathfinding

* Pathfinding part 2

* Pathfinding part 3

* Fix review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants