* fix: lots of fixes and name refactoring * feat: Add workbench preferences * fix: MCP bridge status widget and just command fixes * fix(tests): Use the correct mesa-glx package * fix(ci): Add fontconfig to GUI test dependencies FreeCAD GUI was failing to start with: "Fontconfig error: Cannot load default config file: No such file" Added fontconfig and fonts-dejavu-core packages to the GUI test job dependencies to resolve the font configuration issue. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(addon): Extract path utilities into shared module Create path_utils.py module that consolidates duplicated path-finding logic from commands.py and InitGui.py: - get_addon_path(): Find addon directory with caching and fallbacks - get_icon_path(): Get full path to an icon file - get_icons_dir(): Get path to icons directory - get_workbench_icon(): Get path to workbench main icon This removes ~100 lines of duplicated code while preserving the same behavior including _addon_path_cache and all fallback methods. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(addon): Prevent stale plugin state on startup failure The StartMCPBridgeCommand.Activated method could leave _mcp_plugin in a partially initialized state if FreecadMCPPlugin.start() failed after the plugin was instantiated. Changes: - Create plugin in a local variable first - Only assign to _mcp_plugin after start() succeeds - Explicitly clear _mcp_plugin and _running_config in exception handlers to ensure clean state for subsequent retry attempts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Lot of broad improvements * fix(ci): Use blocking headless_server.py for GUI tests The GUI test was using startup_bridge.py which is non-blocking (designed for interactive use). For CI, even in GUI mode, we need the blocking headless_server.py that calls run_forever() to keep FreeCAD running. GUI features are still available since we use the 'freecad' executable instead of 'freecadcmd'. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor(addon): Rename headless_server.py to blocking_bridge.py The old name was misleading because: - It works with both GUI (freecad) and headless (freecadcmd) modes - The key characteristic is that it BLOCKS with run_forever() New naming convention clarifies the difference: - blocking_bridge.py: Starts bridge and blocks (for CI, servers) - startup_bridge.py: Starts bridge and returns (for interactive GUI) Updated all references across: - GitHub workflow (macro-test.yaml) - Just commands (freecad.just) - Unit tests (test_addon_structure.py) - Documentation (5 files) - CLAUDE.md Also improved the script to detect GUI mode dynamically using FreeCAD.GuiUp and display the appropriate status message. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix(just): Remove erroneous rm of startup_bridge.py on error The startup script is now a permanent source file in the repository, not a generated temporary file. The rm -f would have deleted source code if FreeCAD wasn't found. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: General improvements * fix: Lots of general fixes and only stable to PyPi * fix: small cleanup * fix: Small fixes and hopefully fixes the GUI tests * fix: Add proper library paths for FreeCAD GUI in CI - Create wrapper scripts instead of symlinks for AppImage binaries - Set LD_LIBRARY_PATH, QT_PLUGIN_PATH for GUI mode - Add diagnostic output to identify startup failures * fix: Use apprun for GUI tests in CI * fix: Improving Xvfb tests * fix: GUI tests worlk * chore: remove invalid --no-splash comments * fix: ARM64 architecture support and other fixes * fix: cleanup * test: just commands test suite * test: improve just command tests * fix: more general improvements * fix: more cleanup * fix: more updates * fix: small tweaks --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
90 lines
2.2 KiB
Docker
90 lines
2.2 KiB
Docker
# syntax=docker/dockerfile:1.7
|
|
#
|
|
# Dockerfile for testing FreeCAD GUI with Xvfb
|
|
# Replicates the GitHub Actions CI environment for local debugging
|
|
#
|
|
# Build:
|
|
# docker build -f tests/ci-test/Dockerfile.gui-test -t freecad-gui-test .
|
|
#
|
|
# Run interactively:
|
|
# docker run --rm -it freecad-gui-test
|
|
#
|
|
# Run with local code mounted:
|
|
# docker run --rm -it -v $(pwd):/workspace freecad-gui-test
|
|
|
|
FROM ubuntu:22.04
|
|
|
|
# Avoid interactive prompts during package installation
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install X11, Xvfb, and dependencies (matching CI workflow)
|
|
# hadolint ignore=DL3008
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Xvfb and X11
|
|
xvfb \
|
|
libxkbcommon-x11-0 \
|
|
libxcb-icccm4 \
|
|
libxcb-image0 \
|
|
libxcb-keysyms1 \
|
|
libxcb-randr0 \
|
|
libxcb-render-util0 \
|
|
libxcb-xinerama0 \
|
|
libxcb-xfixes0 \
|
|
libxcb-shape0 \
|
|
libxcb-cursor0 \
|
|
x11-utils \
|
|
libegl1 \
|
|
libgl1-mesa-dri \
|
|
libgl1 \
|
|
mesa-utils \
|
|
fontconfig \
|
|
fonts-dejavu-core \
|
|
# Window manager and X11 tools (required for FreeCAD GUI)
|
|
openbox \
|
|
xdotool \
|
|
# Tools for debugging
|
|
curl \
|
|
jq \
|
|
procps \
|
|
strace \
|
|
psmisc \
|
|
file \
|
|
# Python (for uv/pytest)
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
# For downloading FreeCAD
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& fc-cache -f -v
|
|
|
|
# Install uv for Python package management
|
|
# hadolint ignore=DL3013
|
|
RUN pip3 install --no-cache-dir uv
|
|
|
|
# Set up working directory
|
|
WORKDIR /workspace
|
|
|
|
# Environment variables for GUI testing
|
|
ENV DISPLAY=:99 \
|
|
QT_QPA_PLATFORM=xcb \
|
|
LIBGL_ALWAYS_SOFTWARE=1 \
|
|
FONTCONFIG_FILE=/etc/fonts/fonts.conf \
|
|
FONTCONFIG_PATH=/etc/fonts \
|
|
FREECAD_TAG=1.0.2
|
|
|
|
# Script to setup FreeCAD AppImage
|
|
COPY tests/ci-test/setup-freecad.sh /usr/local/bin/setup-freecad.sh
|
|
RUN chmod +x /usr/local/bin/setup-freecad.sh
|
|
|
|
# Script to run GUI tests
|
|
COPY tests/ci-test/run-gui-test.sh /usr/local/bin/run-gui-test.sh
|
|
RUN chmod +x /usr/local/bin/run-gui-test.sh
|
|
|
|
# Download and setup FreeCAD during build (for faster iteration)
|
|
# hadolint ignore=DL3001,DL3059
|
|
RUN /usr/local/bin/setup-freecad.sh
|
|
|
|
# Default: interactive shell for debugging
|
|
CMD ["/bin/bash"]
|