Skip to content

Commit b6088f4

Browse files
committed
tests: rename video_test_framework_codec.py to vvs_test_runner.py
Shorter, clearer name for the unified test entry point. Update all references in CI, READMEs, and unit tests. Move decode/encode frameworks to libs/ as library modules
1 parent 334cfad commit b6088f4

15 files changed

Lines changed: 371 additions & 1194 deletions

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
3232
- name: Run flake8
3333
run: |
34-
python -m flake8 tests/*/*.py --max-line-length=100 --show-source --statistics
34+
python -m flake8 tests/*.py tests/*/*.py --max-line-length=100 --show-source --statistics
3535
3636
- name: Run pylint
3737
run: |
38-
python -m pylint tests/*/*.py --output-format=text
38+
python -m pylint tests/*.py tests/*/*.py --output-format=text
3939
4040
unit-tests:
4141
name: Unit Tests
@@ -82,4 +82,4 @@ jobs:
8282
8383
- name: Run codec test framework
8484
run: |
85-
python3 ./tests/video_test_framework_codec.py
85+
python3 ./tests/vvs_test_runner.py

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,16 @@ The project includes a comprehensive test framework for validating both encoder
120120

121121
```bash
122122
# Run all tests with default paths
123-
python3 tests/video_test_framework_codec.py
123+
python3 tests/vvs_test_runner.py
124124

125125
# List all available test samples
126-
python3 tests/video_test_framework_codec.py --list-samples
126+
python3 tests/vvs_test_runner.py --list-samples
127127

128128
# Test only H.264 decoder tests
129-
python3 tests/video_test_framework_decode.py --test "decode_h264_*"
129+
python3 tests/vvs_test_runner.py --decoder-only --test "decode_h264_*"
130130

131131
# Test only H.264 encoder tests
132-
python3 tests/video_test_framework_encode.py --test "encode_h264_*"
132+
python3 tests/vvs_test_runner.py --encoder-only --test "encode_h264_*"
133133
```
134134

135135
For complete documentation, command-line options, and advanced usage examples, see **[tests/README.md](tests/README.md)**.

tests/README.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ cmake -B BUILD -DCMAKE_BUILD_TYPE=Release
1010
cmake --build BUILD --parallel
1111

1212
# Run all tests (auto-downloads test samples)
13-
python3 tests/video_test_framework_codec.py
13+
python3 tests/vvs_test_runner.py
1414

1515
# Run only H.264 decoder tests
16-
python3 tests/video_test_framework_codec.py --decoder-only --codec h264
16+
python3 tests/vvs_test_runner.py --decoder-only --codec h264
1717

1818
# Run only encoder tests with verbose output
19-
python3 tests/video_test_framework_codec.py --encoder-only --verbose
19+
python3 tests/vvs_test_runner.py --encoder-only --verbose
2020

2121
# List all available test samples
22-
python3 tests/video_test_framework_codec.py --list-samples
22+
python3 tests/vvs_test_runner.py --list-samples
2323

2424
# Run a specific test by name
25-
python3 tests/video_test_framework_codec.py --test "h264_4k_main"
25+
python3 tests/vvs_test_runner.py --test "h264_4k_main"
2626
```
2727

2828
## Table of Contents
@@ -47,9 +47,9 @@ python3 tests/video_test_framework_codec.py --test "h264_4k_main"
4747

4848
### Core Scripts
4949

50-
- **`video_test_framework_codec.py`** - Unified test orchestrator that runs both encoder and decoder tests
51-
- **`video_test_framework_encode.py`** - Encoder-specific test runner
52-
- **`video_test_framework_decode.py`** - Decoder-specific test runner
50+
- **`vvs_test_runner.py`** - Unified test entry point that runs encoder, decoder, or both tests
51+
- **`libs/video_test_framework_encode.py`** - Encoder test framework classes (library module)
52+
- **`libs/video_test_framework_decode.py`** - Decoder test framework classes (library module)
5353

5454

5555
### Configuration Files
@@ -175,10 +175,10 @@ To add a new decode test sample to `decode_samples.json`:
175175
6. **Test the new entry**:
176176
```bash
177177
# Run only your new test
178-
python3 tests/video_test_framework_codec.py --decoder-only --test "your_test_name"
178+
python3 tests/vvs_test_runner.py --decoder-only --test "your_test_name"
179179

180180
# Verify MD5 validation works
181-
python3 tests/video_test_framework_decode.py --test "your_test_name" --verbose
181+
python3 tests/vvs_test_runner.py --decoder-only --test "your_test_name" --verbose
182182
```
183183

184184
**Notes:**
@@ -297,10 +297,10 @@ To add a new encode test sample to `encode_samples.json`:
297297
6. **Test the new entry**:
298298
```bash
299299
# Run only your new test
300-
python3 tests/video_test_framework_codec.py --encoder-only --test "your_test_name"
300+
python3 tests/vvs_test_runner.py --encoder-only --test "your_test_name"
301301

302302
# With verbose output to see encoder command
303-
python3 tests/video_test_framework_encode.py --test "your_test_name" --verbose
303+
python3 tests/vvs_test_runner.py --encoder-only --test "your_test_name" --verbose
304304
```
305305

306306
**Notes:**
@@ -367,36 +367,36 @@ The framework uses a skip list system to skip tests that are known to fail on sp
367367

368368
```bash
369369
# Run tests ignoring the skip list (run all tests)
370-
python3 video_test_framework_codec.py --ignore-skip-list
370+
python3 vvs_test_runner.py --ignore-skip-list
371371

372372
# Run only skipped tests (useful for testing fixes)
373-
python3 video_test_framework_codec.py --only-skipped
373+
python3 vvs_test_runner.py --only-skipped
374374

375375
# Use a custom skip list
376-
python3 video_test_framework_codec.py --skip-list my_skip_list.json
376+
python3 vvs_test_runner.py --skip-list my_skip_list.json
377377
```
378378

379379

380380
### Usage Examples
381381

382382
#### Run All Tests
383383
```bash
384-
python3 video_test_framework_codec.py
384+
python3 vvs_test_runner.py
385385
```
386386

387387
#### Run Encoder Tests Only
388388
```bash
389-
python3 video_test_framework_codec.py --encoder-only --codec h264
389+
python3 vvs_test_runner.py --encoder-only --codec h264
390390
```
391391

392392
#### Run Specific Test Pattern
393393
```bash
394-
python3 video_test_framework_codec.py --test "*baseline*" --verbose
394+
python3 vvs_test_runner.py --test "*baseline*" --verbose
395395
```
396396

397397
#### Export Results to JSON
398398
```bash
399-
python3 video_test_framework_codec.py --export-json results.json
399+
python3 vvs_test_runner.py --export-json results.json
400400
```
401401

402402
### Command Line Options
@@ -422,17 +422,17 @@ python3 video_test_framework_codec.py --export-json results.json
422422
- `--decode-test-suite FILE` - Path to custom decode test suite JSON file
423423
- `--encode-test-suite FILE` - Path to custom encode test suite JSON file
424424

425-
#### Codec Framework Only (video_test_framework_codec.py)
425+
#### Framework Selection
426426

427427
- `--encoder-only` - Run only encoder tests
428428
- `--decoder-only` - Run only decoder tests
429429

430-
#### Decoder Only (video_test_framework_decode.py)
430+
#### Decode-Specific Options
431431

432-
- `--display` - Enable display output (removes --noPresent flag)
432+
- `--decode-display` - Enable display output for decode tests (removes --noPresent flag)
433433
- `--no-verify-md5` - Disable MD5 verification of decoded output
434434

435-
#### Encoder Only (video_test_framework_encode.py)
435+
#### Encode-Specific Options
436436

437437
- `--no-validate-with-decoder` - Disable validation of encoder output with decoder
438438
- `--decoder-args ARGS` - Additional arguments to pass to decoder during validation
@@ -457,17 +457,17 @@ Tests are automatically prefixed with their type for display:
457457
When filtering tests with `--test`, you can use either the base name or the prefixed name:
458458
```bash
459459
# These are equivalent - run a specific test by base name or full name
460-
python3 video_test_framework_codec.py --test "h264_4k_main"
461-
python3 video_test_framework_codec.py --test "decode_h264_4k_main"
460+
python3 vvs_test_runner.py --test "h264_4k_main"
461+
python3 vvs_test_runner.py --test "decode_h264_4k_main"
462462

463463
# Run only decoder tests (using prefix)
464-
python3 video_test_framework_codec.py --test "decode_*"
464+
python3 vvs_test_runner.py --test "decode_*"
465465

466466
# Run only H.264 encoder tests
467-
python3 video_test_framework_codec.py --test "encode_h264_*"
467+
python3 vvs_test_runner.py --test "encode_h264_*"
468468

469469
# Run all AV1 tests (both encode and decode)
470-
python3 video_test_framework_codec.py --test "av1_*"
470+
python3 vvs_test_runner.py --test "av1_*"
471471
```
472472

473473
---
@@ -491,10 +491,10 @@ The framework supports [Fluster](https://github.com/fluendo/fluster) test suite
491491
Example usage:
492492
```bash
493493
# Use Fluster JVT-AVC_V1 test suite
494-
python3 video_test_framework_decode.py --decode-test-suite path/to/JVT-AVC_V1.json
494+
python3 vvs_test_runner.py --decoder-only --decode-test-suite path/to/JVT-AVC_V1.json
495495

496496
# Filter specific tests from Fluster suite
497-
python3 video_test_framework_decode.py --decode-test-suite JVT-AVC_V1.json --test "*baseline*"
497+
python3 vvs_test_runner.py --decoder-only --decode-test-suite JVT-AVC_V1.json --test "*baseline*"
498498
```
499499

500500
**Note**: Fluster format is only supported for decode tests, not encode tests.
@@ -515,19 +515,17 @@ JSON export includes:
515515
- Individual test results with timing and status information
516516
- Support for both encoder and decoder test results in unified format
517517

518-
### Individual Framework Usage
518+
### Running Specific Test Types
519519

520-
Each component can be run independently:
520+
Use `--encoder-only` or `--decoder-only` to run a single test type:
521521

522522
```bash
523523
# List available samples
524-
python3 video_test_framework_codec.py --list-samples
525-
python3 video_test_framework_encode.py --list-samples
526-
python3 video_test_framework_decode.py --list-samples
524+
python3 vvs_test_runner.py --list-samples
527525

528526
# Encoder tests only
529-
python3 video_test_framework_encode.py
527+
python3 vvs_test_runner.py --encoder-only
530528

531-
# Decoder tests only
532-
python3 video_test_framework_decode.py --display
533-
```
529+
# Decoder tests only with display
530+
python3 vvs_test_runner.py --decoder-only --decode-display
531+
```

tests/libs/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
- video_test_config_base: Base configuration classes and platform utilities
77
- video_test_fetch_sample: Asset download and verification system
88
- video_test_framework_base: Base test framework class and common utilities
9+
- video_test_framework_decode: Decoder test sample and framework classes
10+
- video_test_framework_encode: Encoder test sample and framework classes
911
1012
Copyright 2025 Igalia S.L.
1113
Licensed under the Apache License, Version 2.0

tests/libs/video_test_config_base.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,21 @@ class BaseTestConfig: # pylint: disable=too-many-instance-attributes
244244
source_checksum: str = ""
245245
source_filepath: str = ""
246246

247+
@staticmethod
248+
def _parse_base_fields(data: dict) -> dict:
249+
"""Extract base config fields from a dictionary."""
250+
return {
251+
"name": data["name"],
252+
"codec": CodecType(data["codec"]),
253+
"expect_success": data.get("expect_success", True),
254+
"extra_args": data.get("extra_args"),
255+
"description": data.get("description", ""),
256+
"timeout": data.get("timeout"),
257+
"source_url": data["source_url"],
258+
"source_checksum": data["source_checksum"],
259+
"source_filepath": data["source_filepath"],
260+
}
261+
247262

248263
@dataclass(init=False)
249264
class TestResult:
@@ -486,7 +501,9 @@ def load_and_download_samples(sample_class, json_file: str,
486501
f"{data.get('name', 'unknown')}: {e}")
487502

488503
if not samples:
489-
return True
504+
print(f" Warning: all {len(samples_data)} {test_type} sample(s) "
505+
f"failed to parse")
506+
return False
490507
return download_sample_assets(samples, f"{test_type} test")
491508

492509

tests/libs/video_test_framework_base.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -884,11 +884,4 @@ def _print_single_result(self, result: TestResult) -> None:
884884
print(" --- End of decoder validation output ---")
885885

886886

887-
# Re-export main functions for backwards compatibility
888-
# These are now defined in video_test_framework_main.py
889-
# pylint: disable=wrong-import-position
890-
from tests.libs.video_test_framework_main import ( # noqa: E402
891-
run_framework_main, run_complete_framework_main)
892-
893-
__all__ = ['VulkanVideoTestFrameworkBase', 'run_framework_main',
894-
'run_complete_framework_main']
887+
__all__ = ['VulkanVideoTestFrameworkBase']

0 commit comments

Comments
 (0)