Skip to content

Commit cec4e50

Browse files
test viewer
1 parent 14bf6f8 commit cec4e50

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/test.yaml.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,39 @@ jobs:
3939
- name: Build release binaries
4040
run: cargo build --release --target ${{ matrix.target }}
4141

42-
- name: Create a test PNG
42+
- name: Create a 1x1 test PNG
4343
shell: bash
4444
run: |
45-
cat > test.png <<EOF
46-
# PNG GENERATED AT RUNTIME USING base64
47-
EOF
45+
# 1x1 red pixel PNG (base64)
46+
echo "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGD4DwABBAEAeKwxAAAAAElFTkSuQmCC" \
47+
| base64 --decode > test.png
4848
49-
# 1x1 red pixel PNG (from base64)
50-
echo "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGD4DwABBAEAeKwxAAAAAElFTkSuQmCC" | base64 --decode > test.png
49+
- name: Run reader and capture JSON
50+
shell: bash
51+
run: |
52+
READER=./target/${{ matrix.target }}/release/asimov-image-reader
53+
echo "Running reader..."
54+
set -e
55+
"$READER" file:test.png > image.json
56+
echo "Reader exit code: $?"
57+
echo "Reader output (truncated):"
58+
head -c 500 image.json || true
59+
echo
60+
test -s image.json || (echo "image.json is empty!" && exit 1)
5161
52-
# Run the pipeline and test that it doesn't crash.
53-
# Linux requires a virtual framebuffer, macOS & Windows skip the window.
54-
- name: Run integration test
62+
- name: Run viewer on captured JSON
5563
shell: bash
5664
env:
5765
CI_HEADLESS: "1"
5866
run: |
59-
READER=./target/${{ matrix.target }}/release/asimov-image-reader
6067
VIEWER=./target/${{ matrix.target }}/release/asimov-image-viewer
6168
6269
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
6370
echo "Running viewer inside xvfb..."
64-
xvfb-run -a $READER file:test.png | xvfb-run -a $VIEWER
71+
xvfb-run -a "$VIEWER" < image.json
6572
else
66-
echo "Running headless mode (no window)..."
67-
$READER file:test.png | $VIEWER
73+
echo "Running viewer headless (no real window)..."
74+
"$VIEWER" < image.json
6875
fi
6976
7077
- name: Success

0 commit comments

Comments
 (0)