Skip to content

Next work local

Next work local #92

name: Integration Tests
on:
push:
branches:
- main
paths:
- 'src/api/providers/kanban/**'
- 'src/api/providers/model_server/**'
- 'src/git/**'
- 'src/api/glab_cli.rs'
- 'src/api/gitlab_service.rs'
- 'src/api/pr_service.rs'
- 'tests/kanban_integration.rs'
- 'tests/model_server_integration.rs'
- 'tests/git_integration.rs'
- 'tests/gitprovider_integration.rs'
- '.github/workflows/integration-tests.yml'
pull_request:
branches:
- main
paths:
- 'src/api/providers/kanban/**'
- 'src/api/providers/model_server/**'
- 'src/git/**'
- 'src/api/glab_cli.rs'
- 'src/api/gitlab_service.rs'
- 'src/api/pr_service.rs'
- 'tests/kanban_integration.rs'
- 'tests/model_server_integration.rs'
- 'tests/git_integration.rs'
- 'tests/gitprovider_integration.rs'
workflow_dispatch:
inputs:
run_jira:
description: 'Run Jira integration tests'
type: boolean
default: true
run_linear:
description: 'Run Linear integration tests'
type: boolean
default: true
run_github:
description: 'Run GitHub Projects integration tests'
type: boolean
default: true
run_model_servers:
description: 'Run model-server (provider model-listing) integration tests'
type: boolean
default: true
run_git:
description: 'Run Git integration tests'
type: boolean
default: true
run_git_push:
description: 'Run Git push tests (creates/deletes optest/ branches)'
type: boolean
default: false
run_git_providers:
description: 'Run git-provider (GitHub/GitLab PR service) integration tests'
type: boolean
default: false
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
integration-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0 # Full history needed for git operations
- name: Configure Git for tests
run: |
git config user.email "ci@example.com"
git config user.name "CI"
# Set origin/HEAD if not set (needed for get_default_branch)
git remote set-head origin --auto || true
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.95
- name: Cache cargo
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-integration-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-integration-
- name: Run Jira integration tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_jira) &&
env.OPERATOR_JIRA_DOMAIN != ''
env:
OPERATOR_JIRA_DOMAIN: ${{ secrets.OPERATOR_JIRA_DOMAIN }}
OPERATOR_JIRA_EMAIL: ${{ secrets.OPERATOR_JIRA_EMAIL }}
OPERATOR_JIRA_API_KEY: ${{ secrets.OPERATOR_JIRA_API_KEY }}
OPERATOR_JIRA_TEST_PROJECT: ${{ secrets.OPERATOR_JIRA_TEST_PROJECT }}
run: cargo test --locked --test kanban_integration jira_tests -- --nocapture --test-threads=1
- name: Run Linear integration tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_linear) &&
env.OPERATOR_LINEAR_API_KEY != ''
env:
OPERATOR_LINEAR_API_KEY: ${{ secrets.OPERATOR_LINEAR_API_KEY }}
OPERATOR_LINEAR_TEST_TEAM: ${{ secrets.OPERATOR_LINEAR_TEST_TEAM }}
run: cargo test --locked --test kanban_integration linear_tests -- --nocapture --test-threads=1
- name: Run GitHub Projects integration tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_github) &&
env.OPERATOR_GITHUB_TOKEN != ''
env:
OPERATOR_GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN }}
OPERATOR_GITHUB_TEST_PROJECT: ${{ secrets.OPERATOR_GITHUB_TEST_PROJECT }}
run: cargo test --locked --test kanban_integration github_tests -- --nocapture --test-threads=1
# Model-server (provider model-listing) integration tests.
# Listing models consumes no inference tokens.
- name: Run keyless OpenRouter model-list test
if: github.event_name != 'workflow_dispatch' || inputs.run_model_servers
run: cargo test --locked --test model_server_integration openrouter_keyless -- --nocapture --test-threads=1
- name: Run Anthropic model-list tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_model_servers) &&
env.OPERATOR_ANTHROPIC_API_KEY != ''
env:
OPERATOR_ANTHROPIC_API_KEY: ${{ secrets.OPERATOR_ANTHROPIC_API_KEY }}
run: cargo test --locked --test model_server_integration anthropic -- --nocapture --test-threads=1
- name: Run OpenAI model-list tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_model_servers) &&
env.OPERATOR_OPENAI_API_KEY != ''
env:
OPERATOR_OPENAI_API_KEY: ${{ secrets.OPERATOR_OPENAI_API_KEY }}
run: cargo test --locked --test model_server_integration openai -- --nocapture --test-threads=1
- name: Run Google model-list tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_model_servers) &&
env.OPERATOR_GEMINI_API_KEY != ''
env:
OPERATOR_GEMINI_API_KEY: ${{ secrets.OPERATOR_GEMINI_API_KEY }}
run: cargo test --locked --test model_server_integration google -- --nocapture --test-threads=1
- name: Run keyed OpenRouter model-list tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_model_servers) &&
env.OPERATOR_OPENROUTER_API_KEY != ''
env:
OPERATOR_OPENROUTER_API_KEY: ${{ secrets.OPERATOR_OPENROUTER_API_KEY }}
run: cargo test --locked --test model_server_integration openrouter_keyed -- --nocapture --test-threads=1
- name: Run model-server consistency test
if: github.event_name != 'workflow_dispatch' || inputs.run_model_servers
env:
OPERATOR_ANTHROPIC_API_KEY: ${{ secrets.OPERATOR_ANTHROPIC_API_KEY }}
OPERATOR_OPENAI_API_KEY: ${{ secrets.OPERATOR_OPENAI_API_KEY }}
OPERATOR_GEMINI_API_KEY: ${{ secrets.OPERATOR_GEMINI_API_KEY }}
OPERATOR_OPENROUTER_API_KEY: ${{ secrets.OPERATOR_OPENROUTER_API_KEY }}
run: cargo test --locked --test model_server_integration test_all_providers_return_same_model_shape -- --nocapture --test-threads=1
- name: Run cross-provider tests
env:
OPERATOR_JIRA_DOMAIN: ${{ secrets.OPERATOR_JIRA_DOMAIN }}
OPERATOR_JIRA_EMAIL: ${{ secrets.OPERATOR_JIRA_EMAIL }}
OPERATOR_JIRA_API_KEY: ${{ secrets.OPERATOR_JIRA_API_KEY }}
OPERATOR_JIRA_TEST_PROJECT: ${{ secrets.OPERATOR_JIRA_TEST_PROJECT }}
OPERATOR_LINEAR_API_KEY: ${{ secrets.OPERATOR_LINEAR_API_KEY }}
OPERATOR_LINEAR_TEST_TEAM: ${{ secrets.OPERATOR_LINEAR_TEST_TEAM }}
OPERATOR_GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN }}
OPERATOR_GITHUB_TEST_PROJECT: ${{ secrets.OPERATOR_GITHUB_TEST_PROJECT }}
run: cargo test --locked --test kanban_integration test_provider_interface_consistency -- --nocapture
# Git Integration Tests
- name: Run Git integration tests (read-only)
if: github.event_name != 'workflow_dispatch' || inputs.run_git
env:
OPERATOR_GIT_TEST_ENABLED: 'true'
run: cargo test --locked --test git_integration -- --nocapture --test-threads=1
# NOTE: Git push tests disabled in CI - require authenticated push access
# Run locally with OPERATOR_GIT_PUSH_ENABLED=true to test push operations
# Git Provider Integration Tests (live PrService against gh/glab)
- name: Install glab
if: github.event_name != 'workflow_dispatch' || inputs.run_git_providers
run: |
GLAB_VERSION="1.55.0"
curl -L "https://gitlab.com/gitlab-org/cli/-/releases/v${GLAB_VERSION}/downloads/glab_${GLAB_VERSION}_linux_amd64.tar.gz" | tar xz
sudo mv bin/glab /usr/local/bin/
glab --version
- name: Git provider integration tests
if: >-
(github.event_name != 'workflow_dispatch' || inputs.run_git_providers) &&
env.OPERATOR_GITHUB_TOKEN != ''
env:
OPERATOR_GITPROVIDER_TEST_ENABLED: 'true'
OPERATOR_GITHUB_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.OPERATOR_GITHUB_TOKEN }}
GITLAB_TOKEN: ${{ secrets.OPERATOR_GITLAB_TOKEN }}
GITEA_TOKEN: ${{ secrets.OPERATOR_GITEA_TOKEN }}
OPERATOR_GITPROVIDER_TEST_REPO_GITHUB: ${{ vars.OPERATOR_GITPROVIDER_TEST_REPO_GITHUB || '' }}
OPERATOR_GITPROVIDER_TEST_PR_GITHUB: ${{ vars.OPERATOR_GITPROVIDER_TEST_PR_GITHUB || '' }}
OPERATOR_GITPROVIDER_TEST_REPO_GITLAB: ${{ vars.OPERATOR_GITPROVIDER_TEST_REPO_GITLAB || '' }}
OPERATOR_GITPROVIDER_TEST_PR_GITLAB: ${{ vars.OPERATOR_GITPROVIDER_TEST_PR_GITLAB || '' }}
OPERATOR_GITPROVIDER_TEST_REPO_GITEA: ${{ vars.OPERATOR_GITPROVIDER_TEST_REPO_GITEA || '' }}
OPERATOR_GITPROVIDER_TEST_PR_GITEA: ${{ vars.OPERATOR_GITPROVIDER_TEST_PR_GITEA || '' }}
run: cargo test --locked --test gitprovider_integration -- --nocapture
- name: Cleanup optest branches
if: always()
run: |
# Remove any remaining optest/ branches from remote
git fetch --prune origin
for branch in $(git branch -r | grep 'origin/optest/' | sed 's|origin/||' | xargs); do
echo "Cleaning up orphaned test branch: $branch"
git push origin --delete "$branch" || true
done