integration tests (management API) #4
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: 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| 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' |