jnk_cutter/.woodpecker/.dry_run.yml

135 lines
8.3 KiB
YAML

steps:
ffmpeg_detection:
group: nodep
image: ubuntu:22.04
commands:
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run; then false; fi # missing ffmpeg
- touch ffmpeg
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run; then false; fi # ffmpeg not executable
- chmod +x ffmpeg
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run # ./ffmpeg (missing bc)
- mv ffmpeg ffmpeg.exe
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run # ./ffmpeg.exe (missing bc)
- apt-get update && apt-get -y install bc
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run # ./ffmpeg.exe
- export TMP_FFMPEG_DIR=$(mktemp -d) && mv ffmpeg.exe $TMP_FFMPEG_DIR/ffmpeg && export PATH=$PATH:$TMP_FFMPEG_DIR
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --dry-run # ffmpeg
invalid_time:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- if ./jnk_cutter.sh -i tests/input.mp4 -t 0.1000 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 50.1000 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:50.1000 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50.1000 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 61 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:61 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:61 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 61:00 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:61:00 --dry-run; then false; fi
invalid_time_order:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 9.2 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 9.29 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 9.292 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.3 -t 10.2 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.3 -t 10.29 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.3 -t 10.292 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.30 -t 10.2 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.30 -t 10.29 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.30 -t 10.292 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.300 -t 10.2 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.300 -t 10.29 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10.300 -t 10.292 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 09 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 0:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 00:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 0:0:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 00:0:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 10 -t 00:00:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 0:10 -t 0:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:10 -t 9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 1:10 -t 1:09 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 1:10 -t 01:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 01:10 -t 01:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 0:1:10 -t 0:1:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:1:10 -t 00:1:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:01:10 -t 00:01:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 1:1:10 -t 1:1:09 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 1:1:10 -t 1:01:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 1:01:10 -t 1:01:9 --dry-run; then false; fi
- if ./jnk_cutter.sh -i tests/input.mp4 -t 01:1:10 -t 01:1:9 --dry-run; then false; fi
valid_time:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- ./jnk_cutter.sh -i tests/input.mp4 -t 5 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 50 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 50.1 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 50.10 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 50.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 0:5 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:5 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:05 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 1:5 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:5 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:0 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:00 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:05 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:50 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 1:50.1 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:50.1 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00.05 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:50.10 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 01:50.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 59:59.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:59:59.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:59.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:00.999 --dry-run
- ./jnk_cutter.sh -i tests/input.mp4 -t 20:59:59.999 --dry-run
invalid_input_params:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- if ./jnk_cutter.sh -t 50 --dry-run; then false; fi # undefined input file
- if ./jnk_cutter.sh -t 50 -i invalid_file.mp4 --dry-run; then false; fi # missing input file
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --output-files=file1 --output-prefix=output --dry-run; then false; fi # only one of --output-files or --output-prefix must be defined
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --skip=3 --dry-run; then false; fi # there are only 2 sections
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --skip=0 --dry-run; then false; fi # sections are numbered starting from 1
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --skip=-1 --dry-run; then false; fi # sections are numbered starting from 1
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --skip=x --dry-run; then false; fi # invalid section number
- if ./jnk_cutter.sh -t 50 -i tests/input.mp4 --no-skip --skip=2 --dry-run; then false; fi # --no-skip and --skip flags cannot be used together
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --output-files="bob" --no-skip --dry-run; then false; fi # need exactly 2 filenames
- if ./jnk_cutter.sh -i tests/input.mp4 -t 00:00:50 --output-files="bob,cat,tom" --no-skip --dry-run; then false; fi # need exactly 2 filenames
expect_duration:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- . ./tests/ci.sh
- expect_duration "tests/input.mp4" 60
- if expect_duration "tests/input.mp4" 61; then false; fi # difference larger than tolerance
- if expect_duration "tests/input.mp4" 59; then false; fi # difference larger than tolerance
- if expect_duration "tests/invalid_file.mp4" 60; then false; fi # file missing
- if expect_duration "README.md" 60; then false; fi # unknown file type
validate_cli_parser:
group: nodep
image: quay.io/meisam/ffmpeg:latest
commands:
- ./jnk_cutter.sh -v
- ./jnk_cutter.sh --version
- ./jnk_cutter.sh --help
- if ./jnk_cutter.sh -i tests/input.mp4 -t 5 --dry-run --invalid-flag; then false; fi # invalid flag
- if ./jnk_cutter.sh -i; then false; fi # missing parameter
- if ./jnk_cutter.sh --input; then false; fi # missing parameter