No test in Docker

pull/266/head
Michael Hansen 7 months ago
parent 9d3dcd25a9
commit 5395b787e8

@ -54,25 +54,26 @@ RUN mkdir -p piper && \
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
FROM debian:bullseye as test # FROM debian:bullseye as test
ARG TARGETARCH # ARG TARGETARCH
ARG TARGETVARIANT # ARG TARGETVARIANT
WORKDIR /test # WORKDIR /test
COPY local/en-us/lessac/low/en-us-lessac-low.onnx \ # COPY local/en-us/lessac/low/en-us-lessac-low.onnx \
local/en-us/lessac/low/en-us-lessac-low.onnx.json ./ # local/en-us/lessac/low/en-us-lessac-low.onnx.json ./
# Run Piper on a test sentence and verify that the WAV file isn't empty # # Run Piper on a test sentence and verify that the WAV file isn't empty
COPY --from=build /dist/piper_*.tar.gz ./ # COPY --from=build /dist/piper_*.tar.gz ./
RUN tar -xzf piper*.tar.gz # RUN tar -xzf piper*.tar.gz
RUN echo 'This is a test.' | ./piper/piper -m en-us-lessac-low.onnx -f test.wav # RUN echo 'This is a test.' | ./piper/piper -m en-us-lessac-low.onnx -f test.wav
RUN if [ ! -f test.wav ]; then exit 1; fi # RUN if [ ! -f test.wav ]; then exit 1; fi
RUN size="$(wc -c < test.wav)"; \ # RUN size="$(wc -c < test.wav)"; \
if [ "${size}" -lt "1000" ]; then echo "File size is ${size} bytes"; exit 1; fi # if [ "${size}" -lt "1000" ]; then echo "File size is ${size} bytes"; exit 1; fi
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
FROM scratch FROM scratch
COPY --from=test /test/piper_*.tar.gz /test/test.wav ./ # COPY --from=test /test/piper_*.tar.gz /test/test.wav ./
COPY --from=build /dist/piper_*.tar.gz ./

Loading…
Cancel
Save