Commit graph

1974 commits

Author SHA1 Message Date
Thibault Saunier
4c83b468d6 validate: Always check if scenario is done from the right thread
Action will be set_done from the right thread and we will check if the action is done from there

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/212>
2020-06-27 03:54:54 -04:00
Thibault Saunier
ae3a45d1b6 validate: Print errors on action failures
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
7003d692ca validate: Plug some leaks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
8650c47cd3 validate: Move action finalization to _set_done where it belongs
gst_validate_action_set_done is the place where we should finalize the
action, not in `execute_next`, this way we better handle printing
interlaced action finalization too.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
9c08bfcaca validate:scenario: Replace the sub-action with a foreach action type
Sub-actions were really hard to use and conceptually weird. The
implementation was ugly and made the code complex for nothing.

Instead this commit introduces a `foreach` action type which allows
repeating actions passed in an `actions` array the number of time
specified by any `GstIntRange` value defined in the structure or its
`repeat` field.

This commit also makes sure that all action got through
gst_validate_action_set_done upon finalization.

+ Cleanup surrounding code
+ Add tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
e7355ea039 validate: scenario: Implement 'repeat' by copying actions
Instead of trying to reuse the same action structure and deal with
that in a complex way, copy the action the required number of times.

And add a simple test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
521245fabd validate:scenario: Round results of expressions in a sensible way
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
19550bec3d launcher: Keep running tests forever on KNOWN_ERROR
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
758790ffc9 validate: Add private action type to check number of action type calls
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
800cc245e8 validate:scenario: Avoid dereferencing NULL structure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
02339bd8bb validate: Fix marking expected issues as criticals
And never mark a repeat expected reports as repeated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
b23cb6236d validate: Add a way to use the expression parser in any field
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
f7aba41380 validate: Allow variables to be set with other types than strings
And use value serialization from GStreamer to convert

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
598ec0a5d4 scenario: Add an action to remove a feature/plugin from the registry
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
dda8e7217c valiadate: Add a test for setting/checking (timed) properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
fc440c3ab3 validate:scenario: Add action to set and check several properties at once
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Thibault Saunier
302e9e1123 validate: Add an action type to set timed value properties
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/207>
2020-06-22 17:20:32 +00:00
Vivek R
a2bca5de37 validate: flow: record GstRegionOfInterestMeta
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/206>
2020-06-16 16:23:33 +00:00
Thibault Saunier
f0db9bc907 validate:launcher: Ensure that the main directory exists
Fixes https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/issues/53 part 1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/209>
2020-06-15 18:42:03 -04:00
Thibault Saunier
1f8fec66e0 validate:tests: Cleanup the way set environment vars
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/209>
2020-06-15 18:42:03 -04:00
Thibault Saunier
619fd21174 validate: Stop trying to support uninstalled autotools
Fix https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/issues/53 part 2

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/209>
2020-06-15 18:42:03 -04:00
Thibault Saunier
f5b44d3128 validateflow: Plug leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/205>
2020-06-10 17:30:34 -04:00
Thibault Saunier
c7630833df scenario: Fix waiting for signal
The signal callback signature was just wrong and not generic leading to
crash if waiting for any signal that didn't match it. This commit fixes
it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/205>
2020-06-10 17:30:34 -04:00
Thibault Saunier
ec41001c80 scenario: Add an option to set properties on all instances
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/205>
2020-06-10 17:30:33 -04:00
Thibault Saunier
83ebecef5c validate:flow: Add a way to dump buffer content as hex
Useful in unit tests with very small buffers

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/205>
2020-06-10 17:30:33 -04:00
Thibault Saunier
3b69b73299 validate: Cleanup implementation of appsrc-push
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/205>
2020-06-10 17:30:33 -04:00
Thibault Saunier
70634b1a3f validate: Remove useless condition
CID 1462652

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-07 15:47:36 -04:00
Thibault Saunier
eb6c126068 validate:ssim: Avoid dereferencing NULL pointer
CID 1462650

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-06 06:00:11 +00:00
Thibault Saunier
66972abafc validate: Give a proper argv[0] when running test files
Fixes CID 1462613

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-06 06:00:11 +00:00
Thibault Saunier
fdfe797d4e validate:transcoding: Exit after printing the help
Fixes CID 1455575

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-06 06:00:11 +00:00
Thibault Saunier
f6e45c8c90 validate: Ensure Scenario isn't NULL when preparing action
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/192>
2020-06-06 06:00:11 +00:00
Thibault Saunier
88fcc580be validate: Make extracheck and flow part of core instead plugins
It makes things more complex and doesn't bring anything!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/204>
2020-06-03 11:07:15 -04:00
Edward Hervey
2dd165b4ec launcher: Limit copies of massive debug logs in markdown file
When debugging is activated, we could end up with log files ranging in the
multi-megabyte or even gigabyte range. Copying those is expensive from a cpu/io
point of view in addition to clobbering the storage.

Instead of always copying those files, check if they are smaller than 500kB. If
not, don't copy them and instead provide a link to their location.

Fixes #52

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/203>
2020-06-03 09:39:11 +02:00
Thibault Saunier
124153fe06 validateflow: Allow specifying checksum type
And add an extra mode 'checksum-as-id' which basically numerate
buffers checksums as they are being received so that it is simpler
to compare expectations when you are tracking buffers from both
sinkpads and srcpads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/202>
2020-05-31 17:17:22 -04:00
Thibault Saunier
6a305b1e23 validate: Add a parameter to force waiting on the test clock
This allows to wait for a new buffer to reach the sink without
actually cranking that buffer, allowing to quite the test without
waiting for EOS in a 100% reproducible way

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/201>
2020-05-29 21:12:53 -04:00
Thibault Saunier
774a4a8704 validate: Error out when a config hasn't been used at all
It probably means a plugin is not available

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/201>
2020-05-29 18:16:23 -04:00
Tim-Philipp Müller
cd4836951e Ship validate as part of a gst-devtools tarball
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/199>
2020-05-29 14:30:26 +00:00
Thibault Saunier
ca8cdfd736 validate: Fix mixup in quarks usages
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/200>
2020-05-28 17:17:10 -04:00
Thibault Saunier
0f1dffdcc0 validate: Add missing return func when GLib < 2.50
CID 1463854

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/200>
2020-05-28 17:17:10 -04:00
Thibault Saunier
012288910b validate: Update documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/200>
2020-05-28 17:17:10 -04:00
Thibault Saunier
b1cf1ffebd validateflow: Add a way to configure when to generate expectations
By default, generate them whenever the file is missing but adding a way
to override that with `validateflow,generate-expectations=true` to force
regenerating them or setting `validateflow,generate-expectations=false`
to disallow generating them (on CI servers for example)

Also update the validateflow documentation to take that into account
and remove references to pipeline.json file which is now gone!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/200>
2020-05-28 17:17:10 -04:00
Thibault Saunier
3264de6751 scenario: Minor cleanup around pipeline change state management
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/198>
2020-05-27 19:20:16 +00:00
Thibault Saunier
e1ad840494 scenario: Mark seek as done only when reaching next state
There is a race where following actions could generate a
flush-start/flush-stop dance but the state change resulting from the
seek hasn't been committed yet, leading to the ASYNC_START being
ignored by GstBin since its pending_state is not VOID when receiving
the ASYNC_START message.

Conceptually it is totally correct to consider an action done when
the state change of the pipeline is stabilized..

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/198>
2020-05-27 19:20:16 +00:00
Thibault Saunier
e49876bb05 validate:launcher: Stop wrongly erroring on testsuite loading failure
When the testsuite was actually already loaded as the .py
file was explicitly passed in

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 19:16:27 -04:00
Thibault Saunier
9f11ba5937 validate: Fix loading configs from a caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 19:16:26 -04:00
Thibault Saunier
cf0f1df314 flow: Use bat to color diffs when possible
Adding a function to check if can output colored logs

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 19:16:26 -04:00
Thibault Saunier
91ac75aa4c launcher: check: Properly set PLUGIN_PATH and registry when running in gst-build
This makes registry

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 19:16:26 -04:00
Thibault Saunier
90cc65f7ee launcher: Ensure that -j tests run in parallel when running forever
So that you can reproduce the issue you want faster!

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 17:19:36 -04:00
Thibault Saunier
766f339fb8 launcher: Add support for running tests inside rr
Allowing us to easily run the tests forever and then replay the
failures!

https://rr-project.org/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/197>
2020-05-26 17:19:36 -04:00
Guillaume Desmottes
f78997ec2e validate: add missing gir annotation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/194>
2020-05-25 14:42:01 +00:00