Skip to content
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
34 changes: 13 additions & 21 deletions .github/workflows/test-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ jobs:
command: clippy
# Note that `--all-targets` doesn't refer to targets like
# `wasm32-unknown-unknown`; it refers to lib / bin / tests etc.
args: --all-targets ${{ inputs.target_option }} -- -D warnings
args:
--all-targets --all-features ${{ inputs.target_option }} -- -D
warnings
- name: ⌨️ Fmt
uses: richb-hanover/cargo@v1.1.0
with:
Expand All @@ -53,7 +55,7 @@ jobs:
uses: richb-hanover/cargo@v1.1.0
with:
command: test
args: ${{ inputs.target_option }} --no-run --locked
args: ${{ inputs.target_option }} --all-features --no-run --locked
- name: Run docker compose
run: docker compose up -d
working-directory: ./prql-compiler/tests/integration
Expand All @@ -64,26 +66,16 @@ jobs:
resource: "tcp:5432 tcp:3306 tcp:1433"
timeout: 60000
if: ${{ inputs.os == 'ubuntu-latest' }}
# Only check unreferenced snapshots on the default target tests on ubuntu
#
# (Maybe there's a nicer approach where we can parameterize one step
# rather than have two different ones? We welcome a change to simplify
# this.)
- name: 📋 Test default
- name: 📋 Test
uses: richb-hanover/cargo@v1.1.0
if:
${{ (inputs.target_option != '--target=wasm32-unknown-unknown' &&
runner.os == 'Linux') }}
with:
command: insta
# Autoformatting doesn't make this clear, but:
# - Only check unreferenced snapshots on the default target tests on
# ubuntu.
# - Only enable integration test on linux
args:
test --unreferenced=auto ${{ inputs.target_option }} ${{ inputs.os
== 'ubuntu-latest' && '--features=test-external-dbs' || '' }}
- name: 📋 Test wasm
uses: richb-hanover/cargo@v1.1.0
if:
${{ ! (inputs.target_option != '--target=wasm32-unknown-unknown' &&
runner.os == 'Linux') }}
with:
command: insta
args: test ${{ inputs.target_option }}
test ${{ inputs.target_option != '--target=wasm32-unknown-unknown'
&& '--unreferenced=auto' || ''}} ${{ inputs.target_option }} ${{
inputs.os == 'ubuntu-latest' && '--features=test-external-dbs' || ''
}}
6 changes: 3 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ tasks:

Running this isn't required when developing; it's for caching or as a reference.
cmds:
- cargo build --all-targets --target=wasm32-unknown-unknown
- cargo build --all-targets
- cargo build --all-targets --all-features
- cargo build --all-targets --all-features --target=wasm32-unknown-unknown
- task: build-web

test-all:
Expand Down Expand Up @@ -195,9 +195,9 @@ tasks:
# excluded under wasm. Note that this will also over-delete on Windows.
# Note that we need to pass the target explicitly to manage
# https://github.com/rust-lang/cargo/issues/8899
- cargo insta test --accept
# see #2286
#- cargo insta test --accept --unreferenced=auto
- cargo insta test --accept
- cargo insta test --accept --target=wasm32-unknown-unknown
# We build the book too, because that acts as a test
- cd web/book && mdbook build
Expand Down
2 changes: 1 addition & 1 deletion prql-compiler/tests/integration/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ mod tests {
rusqlite::Connection::open_in_memory().unwrap(),
)));

#[cfg(not(feature = "test-external-dbs"))]
let include_external_dbs = false;
#[cfg(feature = "test-external-dbs")]
let include_external_dbs = true;

if !include_external_dbs {
return connections;
}
Expand Down