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

ci: use cargo insta to run tests #3220

Merged
merged 7 commits into from
Dec 11, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 21 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ jobs:
fail-fast: false
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}

env:
WITH_COVERAGE: ${{ matrix.build == 'darwin-arm64' }}

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -164,15 +167,28 @@ jobs:
}
echo "$(Resolve-Path nasm-2.16.02)" >> $env:GITHUB_PATH

- uses: taiki-e/install-action@cargo-llvm-cov
- name: Install insta test runner
if: ${{ env.WITH_COVERAGE == 'false' && matrix.test != 'false' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-insta

- name: Run cargo insta test
if: ${{ env.WITH_COVERAGE == 'false' && matrix.test != 'false' }}
run: cargo insta test --unreferenced reject --workspace --target ${{ matrix.target }}

- name: Install llvm-cov test runner
if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }}
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov

- name: Run Cargo Test
if: matrix.test != 'false'
# TODO: run llvm-cov only for single build since other builds are not sent to codecov anyway
- name: Run cargo llvm-cov test
if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }}
run: cargo llvm-cov --workspace ${{ matrix.features }} --lcov --target ${{ matrix.target }} --output-path lcov.info

- name: Upload Coverage to Codecov
if: matrix.build == 'darwin-arm64'
if: ${{ env.WITH_COVERAGE == 'true' && matrix.test != 'false' }}
uses: Wandalen/wretry.action@v3
with:
action: codecov/codecov-action@v4
Expand Down
66 changes: 0 additions & 66 deletions .github/workflows/test-jit.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/cli/generator/config.rs
expression: actual
snapshot_kind: text
---
{
"inputs": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/cli/llm/infer_type_name.rs
expression: answer
snapshot_kind: text
---
Answer {
suggestions: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/cli/llm/infer_type_name.rs
expression: request
snapshot_kind: text
---
ChatRequest {
system: None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/blueprint/index.rs
expression: index
snapshot_kind: text
---
Index {
map: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/config_module/merge.rs
expression: merged.unwrap_err()
snapshot_kind: text
---
Validation Error
Enum is used as input type in one subgraph and output type in another [enumOutput]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/config_module/merge.rs
expression: merged.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/config_module/merge.rs
expression: merged.unwrap_err()
snapshot_kind: text
---
Validation Error
Type mismatch: expected `String`, got `Int` [A, a]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/config_module/merge.rs
expression: merged.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/config_module/merge.rs
expression: merged.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { f1 { f1 { f2 } } }
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { f1 { f2 } }
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { t2 { t2 { n } } }
query { t2_ls { t2 } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { bar { spam } }
query { buzz { spam } }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { f1 { f2 { f3 { f4 } } } }
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { f1 { f2 { f3 { f4 } } } }
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: src/core/config/npo/tracker.rs
expression: actual
snapshot_kind: text
---
query { f1 { f2 } }
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
type T1 {
a: Int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
interface GEN__M1 {
a: Int
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/merge_types/type_merger.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/ambiguous_type.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/ambiguous_type.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/flatten_single_field.rs
expression: transformed_config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/improve_type_names.rs
expression: transformed_config.to_sdl()
snapshot_kind: text
---
schema @server(hostname: "0.0.0.0", port: 8000) @upstream(httpCache: 42) {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/improve_type_names.rs
expression: transformed_config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/improve_type_names.rs
expression: transformed_config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/nested_unions.rs
expression: config.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/nested_unions.rs
expression: error
snapshot_kind: text
---
Validation Error
Recursive type U1 [U]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
source: src/core/config/transformer/rename_types.rs
expression: result.to_sdl()
snapshot_kind: text
---
schema @server @upstream {
query: Query
Expand Down
Loading
Loading