Repository navigation
test(interop): load the local GStreamer plugin reliably #6874
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8f50825
quest: plan follow-ups from the 2026-10-25 quest-complete run
kixelated 96f0cab
quest: move the C follow-ups to c-retire and moq-audio's grant
kixelated e543548
chore: claim gst plugin discovery quest
kixelated f4fbe67
fix(interop): consume plugin inspection output before checking factories
kixelated 21145ef
Merge remote-tracking branch 'origin/main' into quest/m1/test-flakes-…
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| """Plugin discovery consumes inspection output and checks both factories.""" | ||
|
|
||
| import os | ||
| from pathlib import Path | ||
| import subprocess | ||
| import tempfile | ||
| import unittest | ||
|
|
||
|
|
||
| SMOKE = Path(__file__).with_name("smoke.sh") | ||
|
|
||
|
|
||
| class SmokeTest(unittest.TestCase): | ||
| def inspect(self, mode): | ||
| with tempfile.TemporaryDirectory() as directory: | ||
| scratch = Path(directory) | ||
| inspect = scratch / "gst-inspect-1.0" | ||
| inspect.write_text('''#!/usr/bin/env python3 | ||
| import os | ||
| import signal | ||
| import sys | ||
|
|
||
| signal.signal(signal.SIGPIPE, signal.SIG_DFL) | ||
| if sys.argv[1] == "--version": | ||
| print("gst-inspect-1.0 test", flush=True) | ||
| else: | ||
| assert sys.argv[1] == "moq" | ||
| assert os.environ["GST_PLUGIN_PATH_1_0"] == os.environ["PLUGIN_DIR"] | ||
| assert os.environ["GST_PLUGIN_SYSTEM_PATH_1_0"] == "" | ||
| assert os.environ["GST_REGISTRY_1_0"] != os.environ["INHERITED_REGISTRY"] | ||
| print(" moqsink: MoQ Sink", flush=True) | ||
| if os.environ["INSPECT_MODE"] != "missing": | ||
| print(" moqsrc: MoQ Src", flush=True) | ||
| # A reader must allow the writer to finish after finding its first match. | ||
| for _ in range(16): | ||
| sys.stdout.write("x" * 4096 + "\\n") | ||
| sys.stdout.flush() | ||
| if sys.argv[1] == "moq" and os.environ["INSPECT_MODE"] == "error": | ||
| sys.exit(1) | ||
| ''') | ||
| inspect.chmod(0o755) | ||
| env = dict(os.environ, PATH=f"{scratch}:{os.environ['PATH']}", BASH_ENV=os.devnull, | ||
| PLUGIN_DIR=str(scratch), INSPECT_MODE=mode, | ||
| GST_PLUGIN_PATH_1_0="inherited", GST_PLUGIN_SYSTEM_PATH_1_0="inherited", | ||
| GST_REGISTRY_1_0=str(scratch / "inherited-registry"), | ||
| INHERITED_REGISTRY=str(scratch / "inherited-registry")) | ||
| return subprocess.run(["bash", str(SMOKE), str(scratch)], env=env, | ||
| text=True, capture_output=True) | ||
|
|
||
| def test_large_inspection_completes(self): | ||
| result = self.inspect("complete") | ||
| self.assertEqual(result.returncode, 0, result.stderr[:1000]) | ||
| self.assertIn("Smoke test passed", result.stdout) | ||
|
|
||
| def test_missing_factory_is_refused(self): | ||
| result = self.inspect("missing") | ||
| self.assertNotEqual(result.returncode, 0) | ||
| self.assertIn("didn't find moqsink/moqsrc", result.stderr) | ||
|
|
||
| def test_inspection_failure_is_refused_even_with_both_factories(self): | ||
| self.assertNotEqual(self.inspect("error").returncode, 0) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.