WORKING
This commit is contained in:
25
tests/e2e/docker/Dockerfile
Normal file
25
tests/e2e/docker/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM --platform=linux/amd64 ubuntu:22.04
|
||||
|
||||
# Prevent interactive prompts during package installation
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install Blender and dependencies including python3-pil
|
||||
RUN apt-get update && apt-get install -y \
|
||||
blender \
|
||||
python3-pip \
|
||||
python3-pil \
|
||||
wget \
|
||||
xvfb \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Set up working directory
|
||||
WORKDIR /addon-test
|
||||
|
||||
# Blender requires a display, use Xvfb for headless operation
|
||||
ENV DISPLAY=:99
|
||||
|
||||
# Copy helper script to run Blender with virtual display
|
||||
COPY run_blender.sh /usr/local/bin/run_blender.sh
|
||||
RUN chmod +x /usr/local/bin/run_blender.sh
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
18
tests/e2e/docker/run_blender.sh
Normal file
18
tests/e2e/docker/run_blender.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# Run Blender in headless mode with virtual display
|
||||
|
||||
# Start Xvfb in background
|
||||
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
XVFB_PID=$!
|
||||
|
||||
# Wait for Xvfb to start
|
||||
sleep 2
|
||||
|
||||
# Run Blender with all arguments passed to this script
|
||||
blender "$@"
|
||||
BLENDER_EXIT=$?
|
||||
|
||||
# Cleanup Xvfb
|
||||
kill $XVFB_PID 2>/dev/null || true
|
||||
|
||||
exit $BLENDER_EXIT
|
||||
Reference in New Issue
Block a user