Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate Rover Tests #2095

Merged
merged 9 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 11 additions & 71 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,6 @@ executors:
XTASK_TARGET: "x86_64-pc-windows-msvc"
LATEST_FED_VERSION_JSON_KEY: "latest-2"

# This is only used to run supergraph-demo since you can't run Docker from Docker
amd_ubuntu: &amd_ubuntu_executor
machine:
image: ubuntu-2004:2024.05.1
resource_class: xlarge
environment:
XTASK_TARGET: "x86_64-unknown-linux-gnu"
CAN_RUN_DOCKER: "true"

# This is used for any xtask command that needs volta installed
volta: &volta_executor
docker:
Expand Down Expand Up @@ -153,45 +144,26 @@ workflows:
jobs:
- xtask:
name: Security Checks
platform: amd_ubuntu
platform: arm_ubuntu
rust_channel: stable
command: security-checks
test:
jobs:
- xtask:
name: Run cargo tests + studio integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
name: Run cargo unit + integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [amd_manylinux, amd_musl, arm_macos, amd_windows]
rust_channel: [stable]
command: [test]

- xtask:
name: Run studio integration tests in GitHub Actions (amd_macos)
context:
- github-orb
matrix:
parameters:
platform: [amd_ubuntu]
rust_channel: [stable]
command: [github-actions]
options:
- |
--workflow-name 'tests-mac-x86.yml' --git-ref "<< pipeline.git.branch >>" --commit-id "<< pipeline.git.revision >>"

- xtask:
name: Run supergraph-demo tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [amd_ubuntu]
rust_channel: [stable]
command: [integration-test]
- install_js:
name: Test installation for Javascript Package Managers (<< matrix.package_manager >> on << matrix.platform >>)
matrix:
parameters:
package_manager: [npm, npm_global, pnpm]
platform: [windows, nix]

- node/test:
name: Test NPM Installer Scripts
app-dir: "~/project/installers/npm"
Expand All @@ -200,37 +172,14 @@ workflows:
release:
jobs:
- xtask:
name: Run cargo tests + studio integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
name: Run cargo unit + integration tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [amd_manylinux, amd_musl, arm_macos, amd_windows]
rust_channel: [stable]
command: [test]
<<: *run_release

- xtask:
name: Run supergraph-demo tests (<< matrix.rust_channel >> rust on << matrix.platform >>)
matrix:
parameters:
platform: [amd_ubuntu]
rust_channel: [stable]
command: [integration-test]
<<: *run_release

- xtask:
name: Run studio integration tests in GitHub Actions for release (amd_macos)
context:
- github-orb
matrix:
parameters:
platform: [ amd_ubuntu ]
rust_channel: [ stable ]
command: [ github-actions ]
options:
- |
--workflow-name 'tests-mac-x86.yml' --git-ref "<< pipeline.git.tag >>" --commit-id "<< pipeline.git.revision >>"
<<: *run_release

- install_js:
name: Test installation for Javascript Package Managers (<< matrix.package_manager >> on << matrix.platform >>)
matrix:
Expand All @@ -255,12 +204,10 @@ workflows:
command: [package]
options: ["--rebuild"]
requires:
- "Run cargo tests + studio integration tests (stable rust on amd_manylinux)"
- "Run cargo tests + studio integration tests (stable rust on amd_musl)"
- "Run cargo tests + studio integration tests (stable rust on arm_macos)"
- "Run cargo tests + studio integration tests (stable rust on amd_windows)"
- "Run studio integration tests in GitHub Actions for release (amd_macos)"
- "Run supergraph-demo tests (stable rust on amd_ubuntu)"
- "Run cargo unit + integration tests (stable rust on amd_manylinux)"
- "Run cargo unit + integration tests (stable rust on amd_musl)"
- "Run cargo unit + integration tests (stable rust on arm_macos)"
- "Run cargo unit + integration tests (stable rust on amd_windows)"
- "Test installation for Javascript Package Managers (npm on nix)"
- "Test installation for Javascript Package Managers (npm_global on nix)"
- "Test installation for Javascript Package Managers (pnpm on nix)"
Expand Down Expand Up @@ -333,7 +280,7 @@ jobs:
type: executor
command:
type: enum
enum: [ lint, unit-test, integration-test, test, package, security-checks, github-actions ]
enum: [ lint, test, package, security-checks ]
options:
type: string
default: ""
Expand Down Expand Up @@ -429,7 +376,7 @@ jobs:
.\install_<< parameters.package_manager >>.ps1

notify_slack:
executor: amd_ubuntu
executor: arm_ubuntu
steps:
- slack/notify:
event: fail
Expand Down Expand Up @@ -474,7 +421,6 @@ commands:
- when:
condition:
or:
- equal: [*amd_ubuntu_executor, << parameters.platform >>]
- equal: [*arm_ubuntu_executor, << parameters.platform >>]
- equal: [*amd_musl_executor, << parameters.platform >>]
- equal: [*volta_executor, << parameters.platform >>]
Expand Down Expand Up @@ -646,20 +592,14 @@ commands:
parameters:
command:
type: enum
enum: [lint, integration-test, unit-test, test, package, security-checks, github-actions]
enum: [lint, test, package, security-checks]
options:
type: string
platform:
type: executor
steps:
- run:
command: |
export GITHUB_ACTIONS_TOKEN="$(echo "$GH_BOT_KEY_B64" | base64 -d)"
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_ACTIONS_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/user
cargo xtask << parameters.command >> << parameters.options >>

- unless:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/run-smokes-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

name: "Run End-To-End Tests"
jobs:
calculate_correct_version_ranges:
name: "Calculate Correct Version Ranges"
runs-on: ubuntu-24.04
outputs:
router_versions: ${{ steps.router-versions.outputs.router_versions }}
supergraph_versions: ${{ steps.supergraph-versions.outputs.supergraph_versions }}
steps:
- name: "Checkout rover repo"
uses: actions/checkout@v4
- name: "Install `semver` cli"
run: |
npm install -g semver
- name: "Get latest Router versions"
id: "router-versions"
working-directory: ".github/scripts"
run: |
ls -al
JSON=$(source get_latest_x_versions.sh 1 apollographql router router latest-1 1)
echo "router_versions=$JSON" >> "$GITHUB_OUTPUT"
- name: "Get latest Supergraph Plugin versions"
id: "supergraph-versions"
working-directory: ".github/scripts"
run: |
ls -al
JSON=$(source get_latest_x_versions.sh 1 apollographql federation-rs supergraph latest-2 2)
echo "supergraph_versions=$JSON" >> "$GITHUB_OUTPUT"
run-smokes:
name: "Run Tests"
needs:
- calculate_correct_version_ranges
uses: ./.github/workflows/smoke-test.yml
with:
composition-versions: '${{ needs.calculate_correct_version_ranges.outputs.supergraph_versions }}'
router-versions: '${{ needs.calculate_correct_version_ranges.outputs.router_versions }}'
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
name: Smoke Tests
jobs:
build_binaries:
name: Build rover & xtask
name: Build Rover & E2E Binary
strategy:
matrix:
compile_target:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
smoke_tests:
timeout-minutes: 15
needs: build_binaries
name: Run smoke tests
name: Run E2E Tests
strategy:
fail-fast: false
matrix:
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/tests-mac-x86.yml

This file was deleted.

7 changes: 5 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# `schemas`
# Examples

This directory contains some example GraphQL schemas to operate on. This is primarily useful for testing Rover commands that take a `--schema` argument.
Apollo publishes a repo called [retail-supergraph](https://github.com/apollosolutions/retail-supergraph/blob/main/DEV.md)
which demonstrates running a supergraph using Rover.

Follow the instructions contained in the link above to run an example of a supergraph with `rover dev`.
2 changes: 0 additions & 2 deletions examples/flyby/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions examples/flyby/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions examples/flyby/package-lock.json

This file was deleted.

Loading