Skip to content

integration tests (management API) #12

integration tests (management API)

integration tests (management API) #12

---
name: integration tests (management API)
on:
schedule:
- cron: '0 2 * * *' # Daily at 02:00 UTC
workflow_dispatch:
inputs:
update_snapshots:
description: 'Update the snapshots?'
required: false
default: 'no'
type: choice
options:
- 'always'
- 'no'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'trunk' && github.sha || 'any-sha' }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_NET_RETRY: 10
CARGO_HTTP_TIMEOUT: 60
jobs:
test-management-api:
name: Test Management API Integration
runs-on: 'spiceai-macos'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
ref: ${{ github.sha }}
fetch-depth: 1
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Authenticate with Spice Cloud dev API
uses: ./.github/actions/management-login
with:
client-id: ${{ secrets.MANAGEMENT_OAUTH_CLIENT_ID }}
client-secret: ${{ secrets.MANAGEMENT_OAUTH_CLIENT_SECRET }}
env-name: SPICE_SPICEAI_TOKEN
- name: Run management API integration tests
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_CLOUD_API_URL: "https://dev-api.spice.ai"
run: |
if [ -z "$SPICE_SPICEAI_TOKEN" ] ; then
echo "Error: SPICE_SPICEAI_TOKEN is not set. Management login may have failed."
exit 1
fi
cargo test -p spice --test cloud_integration -- --test-threads=1
- name: Push snapshots to branch
if: github.event.inputs.update_snapshots == 'always' || github.event_name == 'schedule'
uses: ./.github/actions/push-snap-changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: 'fix: Update Management API integration test snapshots'