diff --git a/.github/workflows/test-rust.yaml b/.github/workflows/test-rust.yaml index be5422e90b03..7bbbfcec676f 100644 --- a/.github/workflows/test-rust.yaml +++ b/.github/workflows/test-rust.yaml @@ -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: @@ -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 @@ -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' || '' + }} diff --git a/Taskfile.yml b/Taskfile.yml index 9a5e052e3b63..a95f7fd7badc 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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: @@ -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 diff --git a/prql-compiler/tests/integration/main.rs b/prql-compiler/tests/integration/main.rs index cd807372030e..65c261305434 100644 --- a/prql-compiler/tests/integration/main.rs +++ b/prql-compiler/tests/integration/main.rs @@ -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; }