PushRelay: loopback /metrics for the self-hosted host #827
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: [master, ci-test] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| python-api-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| working-directory: api/library/python/iterm2 | |
| run: | | |
| pip install -r requirements-dev.txt | |
| pip install -e . | |
| - name: Run tests | |
| working-directory: api/library/python/iterm2 | |
| run: python -m pytest tests/ -v | |
| - name: Run mypy | |
| working-directory: api/library/python/iterm2 | |
| run: python -m mypy iterm2/ | |
| xcode-tests: | |
| runs-on: macos-26 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Select Xcode 26 | |
| # Pin to the same Xcode the committed prebuilt binary dependencies were | |
| # built with. The build phase hard-fails (exit 1) unless `xcodebuild | |
| # -version` matches last-xcode-version byte for byte, so the build | |
| # number has to line up, not just the marketing version. | |
| run: sudo xcode-select -s /Applications/Xcode_26.5.app/Contents/Developer | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Kill orphan Xcode processes | |
| run: | | |
| killall ibtoold 2>/dev/null || true | |
| killall AssetCatalogSimulatorAgent 2>/dev/null || true | |
| - name: Configure AI live harness for offline cassette replay | |
| run: | | |
| # The ModernTests scheme includes AILiveHarness, which is opt-in and | |
| # skips itself unless this config file exists. Write it in replay | |
| # mode so the harness runs entirely from the committed cassettes | |
| # (ModernTests/Resources/AICassettes) instead of hitting vendor APIs. | |
| # Keys are dummies on purpose: canonicalization replaces the key with | |
| # <SECRET> so any non-empty value matches the recorded request, and | |
| # replay never makes a network call, so if a request isn't cached the | |
| # test fails loudly rather than silently spending money. PROJECT_ROOT | |
| # lets the harness find the cassettes and the on-disk fixtures. | |
| cat > /tmp/iterm2-ai-live.json <<JSON | |
| { | |
| "OPENAI_API_KEY": "sk-dummy-ci", | |
| "ANTHROPIC_API_KEY": "sk-ant-dummy-ci", | |
| "GEMINI_API_KEY": "dummy-ci", | |
| "DEEPSEEK_API_KEY": "sk-dummy-ci", | |
| "LLAMA_API_KEY": "ollama-dummy-ci", | |
| "CASSETTE_MODE": "replay", | |
| "PROJECT_ROOT": "${GITHUB_WORKSPACE}" | |
| } | |
| JSON | |
| chmod 0600 /tmp/iterm2-ai-live.json | |
| echo "Wrote AI live cassette-replay config (PROJECT_ROOT=$GITHUB_WORKSPACE)" | |
| - name: Run tests | |
| run: | | |
| # Retry up to 3 times, but only for flaky ibtoold/asset catalog crashes | |
| for attempt in 1 2 3; do | |
| echo "::group::Attempt $attempt of 3" | |
| rm -rf TestResults.xcresult build_output.txt | |
| # Run xcodebuild and capture output | |
| set +e | |
| xcodebuild test \ | |
| -project iTerm2.xcodeproj \ | |
| -scheme ModernTests \ | |
| -parallel-testing-enabled NO \ | |
| -resultBundlePath TestResults.xcresult \ | |
| CODE_SIGN_IDENTITY="" \ | |
| CODE_SIGNING_REQUIRED=NO \ | |
| CODE_SIGNING_ALLOWED=NO 2>&1 | tee build_output.txt | |
| # tee always exits 0, so $? here is tee's, not xcodebuild's. Use | |
| # PIPESTATUS[0] to get xcodebuild's real exit code, otherwise a | |
| # build/test failure masquerades as a pass. | |
| exit_code=${PIPESTATUS[0]} | |
| set -e | |
| echo "::endgroup::" | |
| if [ $exit_code -eq 0 ]; then | |
| echo "Tests passed on attempt $attempt" | |
| exit 0 | |
| fi | |
| # Check if this is a flaky ibtoold/asset catalog crash | |
| if grep -q "CompileAssetCatalogVariant failed\|IBPlatformToolFailureException\|The tool closed the connection" build_output.txt; then | |
| echo "::warning::Attempt $attempt failed due to flaky ibtoold crash (known Xcode 26 issue)" | |
| if [ $attempt -lt 3 ]; then | |
| echo "Retrying..." | |
| killall ibtoold 2>/dev/null || true | |
| killall AssetCatalogSimulatorAgent 2>/dev/null || true | |
| sleep 5 | |
| continue | |
| else | |
| echo "::error::All 3 attempts failed due to flaky ibtoold crashes" | |
| exit 1 | |
| fi | |
| else | |
| # Real test failure - don't retry | |
| echo "::error::Tests failed (not a flaky ibtoold issue)" | |
| exit 1 | |
| fi | |
| done | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-results | |
| path: TestResults.xcresult | |
| retention-days: 7 |