Commit graph

1764 commits

Author SHA1 Message Date
Thibault Saunier
48fa4b6c4b validate:scenario: Clear up last seek on EOS generating a 'stop' action
Otherwise there is a race leading to a segfault where ASYNC_DONE is
received *after* generating EOS ourselves:

```
Executing stop (
    - generated-after-eos=true
)
<Caught SIGNAL: SIGSEGV>

**Stack trace**:

...
Thread 1 (Thread 0x7f3c3e50df00 (LWP 10183)):
    #8  0x00007f3c3f01bea5 in g_cclosure_marshal_generic (closure=<optimized out>, return_gvalue=<optimized out>, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gclosure.c:1496
    #9  0x00007f3c3f01b3dd in g_closure_invoke (closure=0x1855980, return_value=0x0, n_param_values=2, param_values=0x7ffda2e0a7e0, invocation_hint=0x7ffda2e0a760) at gclosure.c:810
    #10 0x00007f3c3f02e983 in signal_emit_unlocked_R (node=node@entry=0x15af670, detail=detail@entry=298, instance=instance@entry=0x171fc80, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7ffda2e0a7e0) at gsignal.c:3635
    #11 0x00007f3c3f037aaa in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7ffda2e0a9c0) at gsignal.c:3391
[Inferior 1 (process 10183) detached]

```
2019-04-03 13:38:42 +00:00
Thibault Saunier
0a2af1b027 validate:launcher: Add generated known issue list to the logs instead of printing then 2019-04-03 13:38:42 +00:00
Thibault Saunier
c8a3b34a3a validate:launcher: Add a way to force stdout coloring 2019-04-03 13:38:42 +00:00
Thibault Saunier
ac7efe9500 validate:launcher: Rework expected-issues data format
Instead of having the issues centered on the test classes, they
are now focusing on the "bug".

And harmise names on `expected_issue` not `expected_failures`
2019-04-03 13:38:42 +00:00
Thibault Saunier
6a4639352b validate:launcher: Allow printing log URL on a CI server 2019-04-03 13:38:42 +00:00
Thibault Saunier
06b8f23a34 validate:launcher: Fix getting skip-parser when generating media descriptor
On old version it didn't exist
2019-04-03 13:38:42 +00:00
Thibault Saunier
19dfd63408 validate:launcher: Review default for --mute
`--mute` is now True by default and added `--unmute` if the user wants
to have visual/audio feedback. It was really annoying to have thousand
of window pop up by default
2019-04-03 13:38:42 +00:00
Thibault Saunier
a77825ecbc validate:launcher: Allow referencing known issue by exiting signal names 2019-04-03 13:38:42 +00:00
Thibault Saunier
7dbdb84ca8 validate:launcher: Output markdown as much as possible 2019-04-03 13:38:42 +00:00
Thibault Saunier
3a826e1e3d validate:launcher: Implement bug checks for gitlab
And use new gitlab urls for all the bugs
2019-04-03 13:38:42 +00:00
Thibault Saunier
8d00a74f1a validate:launcher: Enhance and standardize output 2019-04-03 13:38:42 +00:00
Thibault Saunier
fca2411e77 validate:scenario: Add a way to ignore EOS
And ignore then in seek_forward/backward to avoid cases where the pipeline EOS
before we have the chance to launch the following seek, see:

https://ci.gstreamer.net/job/GStreamer-master-meson-validate/3483/testReport/junit/(root)/gst-validate-launcher/validate_rtsp_playback_seek_backward_raw_h264_1_mp4/
2019-04-03 13:38:42 +00:00
Thibault Saunier
ad28bffa20 validate:launcher: Take into account the timeout when checking EOS 2019-04-03 13:38:42 +00:00
Thibault Saunier
6f9e5d4494 Pass python files through autopep8 2019-04-03 13:38:42 +00:00
Thibault Saunier
091ce6bcfe validate:launcher: Help the user add known issues
And make it clear a bug should be opened about it
2019-04-03 13:38:42 +00:00
Thibault Saunier
b4e96b4f4e validate:launcher: Enhance dumping log files output 2019-04-03 13:38:42 +00:00
Thibault Saunier
3d5099ee41 validate:launcher: Use gst-integration-testsuites subproject as default testsuite repo if avalaible 2019-04-03 13:38:42 +00:00
Philipp Zabel
99eaad17e2 validate: fix pause duration handling
Commit 394242c224 ("validate:scenario: Enhance variable
implementation") caused the duration parameter to be stored
as a double instead of GstClockTime, which the _execute_pause
implementation expects. Fix the parameter type and use
gst_validate_action_get_clocktime to handle duration correctly.

https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/73
2019-04-02 20:55:41 +00:00
Nicolas Dufresne
40755c2d90 meson: validate: Fix linking error missing GstBaseTransform
There is a mockdecryptor that has been added into validate-sources and
this element is base on GstBaseTransform. This added a deps against
gstbase which was leading to linking errors when building with meson.
2019-04-01 14:51:31 -04:00
Jimmy Ohn
6754d4e9f2 validate: Print some log when environment variable is not set
print some log when environment variable is not set
2019-04-01 21:40:58 +09:00
Tim-Philipp Müller
9521fdbf88 meson: validate: actually pass extra arguments to gnome.generate_gir()
Especially the init section and the --quiet.

Remove the whole manual build/source dir include addition
to the g-ir-scanner args seeing that things worked fine
without the args being passed to the scanner at all.
2019-03-23 19:51:08 +00:00
Tim-Philipp Müller
d99994a849 validate: fix g-i warnings
gst-validate-utils.c:914: gst_validate_element_matches_target: unknown parameter 'structure' in documentation comment, should be 's'
gst-validate-override-registry.h:49: gst_validate_override_registry_get_override_list: return value: Missing (element-type) annotation
2019-03-23 19:47:24 +00:00
Xavier Claessens
ad24cb1b77 Avoid C99 declaration in 'for' loop 2019-03-22 15:37:37 -04:00
Thibault Saunier
6310145a44 validate:launcher: Set CK_MULTIPLIER=10 in GstCheck tests when using valgrind
Fixes https://gitlab.freedesktop.org/gstreamer/gst-devtools/issues/39
2019-03-22 11:23:08 -03:00
Matthew Waters
f6ae425a1a validate: allow building a static overrides library 2019-03-18 01:07:05 +00:00
Charlie Turner
ab0be78469 validate: Add a mock decryptor element. 2019-03-15 22:18:29 +00:00
Alicia Boya García
e536b05e5a validateflow: Fail when a pad is not attached
Previously validateflow tests did not fail when the pad was not
attached.

This was a limitation caused by how the Validate API worked. Before, the
`notify::validate-runner` signal was not emitted until a monitor was
attached to the override. This made impossible to listen for the
runner's `stopping` signal.

This patch fixes the problem by setting `validate-runner` for all
existing overrides when the runner is initialized and adding checks in
validateflow to error in the case no pad was attached.
2019-03-15 17:38:15 +00:00
Thibault Saunier
773f2e456c validate:launcher: Move '_format_config_template' to the utilities
So it can be reused by GES tests
2019-03-11 18:14:23 -03:00
Thibault Saunier
c9eaf1fc02 validate: Check that position <= duration from the pipeline monitor
We should not require a scenario for that check to happen
2019-03-11 18:14:23 -03:00
Thibault Saunier
c32c3e82d6 validate:scenario: Cleanup spurious error message 2019-03-11 18:14:23 -03:00
Thibault Saunier
b61cb56e20 validate-flow: Add an ignored-event-fields configuration
It replaces `record-stream-id` as it is a more generic way of doing
the same thing.
2019-03-11 18:14:23 -03:00
Edward Hervey
9772e0c1d2 validate: More usage of g_strcmp0 instead of strcmp 2019-03-06 10:15:21 +01:00
Edward Hervey
ec7cd5a092 validateflow: Use glib variant of strcmp
safer, and avoids missing include
2019-03-06 10:11:59 +01:00
Edward Hervey
a750e3b540 validate: Include config.h before anything else
To avoid double-defines (such as GST_LEVEL_DEFAULT)
2019-03-04 15:20:49 +01:00
Tim-Philipp Müller
4893d6d561 Back to development 2019-03-04 09:15:11 +00:00
Tim-Philipp Müller
3fface0275 Release 1.15.2 2019-02-26 19:44:21 +00:00
Tim-Philipp Müller
61f1289dcc scenarios: don't clobber scenarios in 'make install'
/usr/bin/install: will not overwrite just-created '_inst/share/gstreamer-1.0/validate/scenarios/default-seek-flags.scenario' with '../../../../data/scenarios/rtsp_overrides/includes/default-seek-flags.scenario'

https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/44#note_123683
2019-02-26 19:44:21 +00:00
Tim-Philipp Müller
536a7dddb1 validate: add new API to exports file 2019-02-26 18:53:58 +00:00
Thibault Saunier
c7270b2d8a validate: Notice that issue summaries should be 'stable'
As they are used in the testsuite to define known issues
2019-02-24 00:44:57 +00:00
Alicia Boya García
f0abd316e2 gst-validate-scenario: Make waits optional in appsrc-push
While in many cases it's desirable to wait for a buffer to be pushed
downstream when using appsrc-push, in some cases this is not possible as
such pushing action is dependent on following actions that would not be
executed if we wait.

An example for this is prerolling:

    appsrc ! qtdemux ! video/x-h264 ! decodebin name=dec ! %(videosink)s

    description, seek=false, handles-states=true
    appsrc-push, target-element-name=appsrc0, file-name="raw_h264.0.mp4"
    set-state, state=playing
    appsrc-eos, target-element-name=appsrc0

In order for the preroll to occur, both the appsrc needs to push the
buffer and the state needs to reach PLAYING. But `set-state` cannot
finish if the buffer has not been pushed (the state transition does not
finish) and conversely pushing the buffer will not finish until the
state has reached.

Making appsrc-push not wait for the buffer solves this problem. This
patch makes appsrc-push aware of this issue by only waiting for the
buffer to be pushed if the pipeline is in a state that allows buffers to
flow.
2019-02-24 01:23:58 +01:00
Alicia Boya García
af205f63b7 gst-validate-scenario: Fix (another) race condition in EOS handling
Since gst_validate_action_set_done() is asynchronous, the bus EOS
handler may already be running before the action is actually finished.
This patch ensures that is not a problem.
2019-02-22 00:02:08 +01:00
Charlie Turner
a443b921a2 validateflow: interpolate folder directories into pipeline descriptions.
Allow 'pipeline' fields in validateflow to be interpolated with
directory keys like $(medias)s.
2019-02-21 13:57:17 +00:00
Guillaume Desmottes
b20f73099f validate: allow config to check for minimum buffer frequency on pads
This change allow tests to check performance of elements by checking the
frequency at which buffers are pushed on src pads.
I re-used most of the logic from fpsdisplaysink to compute the
frequency.

We can now uses something like:
  GST_VALIDATE_CONFIG='core,min-buffer-frequency=60,target-element-factory-name=v4l2src'

The 'buffer-frequency-start' optional field can be used to ignore the
frequency during the start of the pipeline. This is useful when testing live
pipelines where configuring and setting up elements can take some time slowing
down the first buffers.
2019-02-20 12:12:46 +01:00
Guillaume Desmottes
40f263e857 validate: factor out gst_validate_element_matches_target() 2019-02-20 12:12:46 +01:00
Charlie Turner
4602ee61c4 validateflow: Fix double-free on stdout 2019-02-18 11:05:26 +00:00
Thibault Saunier
34b5192b94 validate: report: Fix the way we print 'repeat' values 2019-02-15 14:19:03 +00:00
Thibault Saunier
53b2ca8f62 validate: Force LC_NUMERIC to C as it is required by our expression parser
And... add some expression parser unit tests
2019-02-15 14:19:03 +00:00
Thibault Saunier
394242c224 validate:scenario: Enhance variable implementation
- Stop arbitrarily consider params as ClockTime based on their names
  but add a convetion that the `.type` field of the ActionType should
  end by `(GstClockTime)` when it is a clock time.
2019-02-15 14:19:03 +00:00
Thibault Saunier
b7616e5fab validate:scenario: Make gst_validate_action_new public
Mainly so it can be used in unit tests.
2019-02-15 14:19:03 +00:00
Thibault Saunier
be854d4be8 validate:scenario: Allow using set-vars from numeric expressions
And require them to follow the `$varname` (can't be $(varname) as
parenthesis have another meaning in those expressions).

Still accept "duration" and "position" as varname for backward compat
but update our scenarios anyway.
2019-02-15 14:19:03 +00:00
Thibault Saunier
28e041b2cb validate: scenario: Parse playback times as we execute the scenario
This way we will be able to use 'set-vars' for it
2019-02-15 14:19:03 +00:00
Thibault Saunier
d24477d9e4 validate:scenario: Enforce a synthax $(varname) to reference variables
This way it is clear that you are using a variable reading the scenario
and we can verify that what the scenario writer intents is to use an
already set variable.
2019-02-15 14:19:03 +00:00
Guillaume Desmottes
3ebc26e265 validate: don't override max-latency if config contains multiple structs
gst_validate_utils_get_clocktime() is resetting the value if it's not
present in the struct so we were overriding it on the next iterations.
2019-02-12 02:21:14 +00:00
Guillaume Desmottes
da22878a5f validate: baseclasses: include env variable in logged command
We were missing the env variables in the command written to the log
file, making it impossible to re-run the test later from the logs.
2019-02-11 15:17:33 +00:00
Alicia Boya García
1d4801d679 gst-validate-scenario: Add GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK
There was a race in appsrc-push when the pushed buffer caused an EOS.
The EOS event could be handled by the main thread, finishing the test
while the action, executing in the streaming thread, has not finished
yet.

A mutex is now introduced to add mutual exclusion for the two threads so
that an EOS does not cause the termination of the test while the action
is still going.
2019-02-11 14:15:30 +00:00
Thibault Saunier
5a2e2d5001 validateflow: Print some indication that the flow checking is happening 2019-02-11 08:34:36 -03:00
Edward Hervey
4467c9925d validate: Add autotools support for flow plugin 2019-02-11 11:09:46 +01:00
Thibault Saunier
3d3264b342 Revert "validate:launcher: Cache the result of meson introspect"
This reverts commit 05ce6d3b92.

We can't do that as it breaks meson logic to set envvars
2019-02-10 01:25:52 -03:00
Thibault Saunier
5a6307f913 validate:launcher: Do not sort tests all the time
Do it once only once it is fully populated
2019-02-09 17:25:03 -03:00
Thibault Saunier
05ce6d3b92 validate:launcher: Cache the result of meson introspect
Running it takes quite some time and we can easily cache it.
2019-02-09 17:24:13 -03:00
Thibault Saunier
a88156a416 validate:launcher: Add a simple way to profile app 2019-02-09 17:23:28 -03:00
Guillaume Desmottes
0e03b38cc2 validate: scenario: not need to use an atomic to handle dropped count
It's all handled from the same thread.
2019-02-08 14:39:22 +01:00
Guillaume Desmottes
78a8306955 validate: scenario: fix dropped checking when terminating scenario
We want to early return if either no max value has been set for the
scenario or if we didn't receive any QoS information.
2019-02-08 14:25:52 +01:00
Guillaume Desmottes
916bf5cdf1 validate: properly namespace config related checks 2019-02-08 13:32:12 +01:00
Alicia Boya García
e96f2ca714 New validate plugin: validateflow
validateflow can be used to check the buffers and events flowing through
a custom pipeline match an expectation file. This can be used to test
non-regular-playback use cases like demuxers handling adaptive streaming
fragment pushing.

This patch includes also new actions used for these cases:
`appsrc-push`, `appsrc-eos` and `flush` (plus `checkpoint`, which is
only available with validateflow).
2019-02-07 18:19:22 +00:00
Guillaume Desmottes
0c83ff56dd baseclass: add_validate_config: don't use self.proc_env
self.proc_env is created when starting the test but this API can be call
by generator when creating the test.
2019-02-07 17:13:02 +01:00
Guillaume Desmottes
921a073bdf validate: allow scenarios to define a max nb of dropped buffers
The 'max-dropped' description field can now be used to specify the max
number of buffers than can be dropped by the QoS system.
2019-02-07 14:12:59 +00:00
Thibault Saunier
e8162cc957 validate:launcher: Error out in the check testsuite if rebuilding failed 2019-02-06 21:14:13 +00:00
Guillaume Desmottes
2d8ef6e81c validate: allow scenarios to define max pipeline latency
The 'max-latency' description field can now be used to specify the max
latency allowed for the running pipeline.
2019-02-06 16:07:02 +01:00
Mathieu Duponchelle
90c2d32030 Scenarios: override seek flags for RTSP tests
Our RTSP server is not accurate, it makes no sense to perform
accuracy checks on the client-side segments.
2019-02-02 02:08:58 +01:00
Thibault Saunier
49102316df validate:scenario: Set variables on all action fields 2019-02-01 23:46:21 +00:00
Thibault Saunier
e50d41420e validate: Handle G_LOG_ERROR in our glog handler 2019-02-01 23:46:21 +00:00
Thibault Saunier
2f957ab932 validate:scenario: Rename action 'define-consts' to 'set-vars'
Those are not consts are they can be modified at runtime
2019-02-01 23:46:21 +00:00
Thibault Saunier
d0ee26e950 validate: Cleanup flags/enum_from_string 2019-02-01 23:46:21 +00:00
Mathieu Duponchelle
f9190236af scenario: prioritize SCENARIOS_PATH when including 2019-02-01 23:08:16 +01:00
Thibault Saunier
71d2e3f418 validate: Let people know the testsuite starts running
Now that we do not print infos about successful tests when redirecting.
2019-02-01 01:24:33 -03:00
Thibault Saunier
ba9b2c5ec5 validate: Keep trying to print stack traces when our log hanlder is removed
There are cases where a crash happens after the program ends
2019-02-01 00:08:45 -03:00
Thibault Saunier
68573ae919 validate:scenario: Give pipeline position when failling on EOS 2019-01-31 23:47:11 -03:00
Thibault Saunier
35003bc25b validate:launcher: Do not print passing tests if not running in a tty 2019-01-31 23:47:11 -03:00
Thibault Saunier
25e0694d1e validate:scenario: Explicitely mark generated stop() action as such 2019-01-31 22:37:17 -03:00
Thibault Saunier
78781de913 validate:launcher:punittest: Raise an exception if a testsuite can't be loaded 2019-01-30 15:57:13 -03:00
Edward Hervey
d1319a1b6d pad-monitor: Remove unused pad getrange override 2019-01-30 14:30:52 +01:00
Edward Hervey
de59b3ad00 validate: Use g_object_{get|set}_qdata where applicable
This provides a substantial speedup compared to using strings
2019-01-30 14:29:48 +01:00
Mathieu Duponchelle
d5e3f4d31c TestsManager: stop displaying blacklisted tests on stdout
It's basically spam, better suited to the debug logs
2019-01-30 00:27:32 +00:00
Thibault Saunier
440055214a validate:launcher: Never print lines larger than the terminal 2019-01-29 16:09:30 -03:00
Thibault Saunier
7e70bf8729 validate: scenario: Mark action as being executed right before calling ->execute
And make sure that we do not try to execute the following action

In the case the action type leads to the GMainContext to be ieterated
2019-01-29 13:09:36 -03:00
Jordan Petridis
31164cf0a6 validate: Report the full test name in the xunit file
Looks like gitlab prefers this way of representing tests as it
displays only the name field in its junit reports.

Close #32
2019-01-26 16:55:23 +00:00
Thibault Saunier
2551e8750e validate:launcher: Make baseclasses.py pep8 compliant 2019-01-26 15:54:00 +00:00
Thibault Saunier
9b69bcad08 validate:launcher: Handle launching launching a sub launcher
If you use validate-launcher in a meson testsuite, those test now
gets integrated as one unique testsuite (with a pretty long namespace).
2019-01-26 15:54:00 +00:00
Thibault Saunier
6665652cff validate:launcher: Refactor the "main" function
- Move the parser code into a `LauncherConfig.create_parser()` method
- Remove the need to pass libsdir to the _TestsLauncher object
- Extract out a `setup_launcher_from_args` function
2019-01-26 15:54:00 +00:00
Thibault Saunier
1b3867b82d launcher: Move http serveur and xvfb server to the main test runner object
No good reason for it to be in the main function
2019-01-26 15:54:00 +00:00
Thibault Saunier
3f4f815500 launcher: Cleanup the way we find python test command line
By setting it before the test base class adds the current testsuite name in the classname
2019-01-26 15:54:00 +00:00
Thibault Saunier
9cf213dee0 launcher: Fix test listing in meson VS gstcheck tests
You might select tests that match Meson but not gstcheck in which
case the 'meson only' variant is exposed but those should never exist.
2019-01-26 15:54:00 +00:00
Thibault Saunier
a3bab7c66e validate:launcher: Add %(config_path)s in the pipeline desc vars
When defining pipelines_descriptions to run test on in a `.json` file, you might
need to point to paths in the testsuite directory (for media files URIs
for example), you can now do

 `"pipeline": "filesrc location="$(config_path)s/../medias/some/file.mkv...`
2019-01-26 10:11:24 -03:00
Tim-Philipp Müller
2dd8395ee8 Release 1.15.1 2019-01-17 10:01:50 +00:00
Tim-Philipp Müller
ce007a7dcb Fix distcheck
Work around broken disthook check in release.mak so we don't
have to update the common submodules for that (applies only
to this module because the version number is in the top-level
meson.build but the package/dist directory is a subdir). This
only became a problem now because the common submodule hadn't
been updated for the last few years.
2019-01-17 10:00:46 +00:00
Tim-Philipp Müller
3c6769b9f5 win32: update .def file for new API
Fixes distcheck
2019-01-17 09:38:13 +00:00
Thibault Saunier
7befe3d033 validate:launcher: Display unix nickname of signals leading to test failure 2019-01-15 16:55:32 -03:00
Thibault Saunier
5692f8d74d validate:launcher: Fix error message about 'crashed' test 2019-01-15 16:05:41 -03:00
Thibault Saunier
92483ae210 validate: Plug newly introduced leak 2019-01-12 15:25:53 -03:00