Merge pull request #1603 from daira/ci-logs-should-have-backtraces

Dev quality-of-life improvements (better test backtraces in CI and locally; faster test builds; `RUST_BACKTRACE=1` by default)
This commit is contained in:
Daira-Emma Hopwood 2024-11-02 19:36:44 +00:00 committed by GitHub
commit c6db09b25a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 19 additions and 69 deletions

2
.cargo/config.toml Normal file
View File

@ -0,0 +1,2 @@
[env]
RUST_BACKTRACE = "1"

View File

@ -64,13 +64,11 @@ jobs:
- name: Run tests
run: >
cargo test
--release
--workspace
${{ steps.prepare.outputs.feature-flags }}
- name: Run slow tests
run: >
cargo test
--release
--workspace
${{ steps.prepare.outputs.feature-flags }}
--features expensive-tests

1
.gitignore vendored
View File

@ -1,2 +1 @@
target
.cargo

View File

@ -1,66 +0,0 @@
# /************************************************************************
# File: .gitlab-ci.yml
# Author: mdr0id
# Date: 9/10/2018
# Description: Used to setup runners/jobs for librustzcash
# Usage: Commit source and the pipeline will trigger the according jobs.
# For now the build and test are done in the same jobs.
#
# Known bugs/missing features:
#
# ************************************************************************/
stages:
- build
- test
- deploy
rust-latest:
stage: build
image: rust:latest
script:
- cargo --verbose --version
- time cargo build --verbose
rust-nightly:
stage: build
image: rustlang/rust:nightly
script:
- cargo --verbose --version
- cargo build --verbose
allow_failure: true
librustzcash-test-latest:
stage: test
image: rust:latest
script:
- cargo --verbose --version
- time cargo test --release --verbose
librustzcash-test-rust-nightly:
stage: test
image: rustlang/rust:nightly
script:
- cargo --verbose --version
- cargo test --release --verbose
allow_failure: true
#used to manually deploy a given release
librustzcash-rust-rc:
stage: deploy
image: rust:latest
script:
- cargo --verbose --version
- time cargo build --release --verbose
when: manual
#used to manually deploy a given release
librustzcash-rust-nightly-rc:
stage: deploy
image: rustlang/rust:nightly
script:
- cargo --verbose --version
- cargo build --release --verbose
allow_failure: true
when: manual

View File

@ -162,5 +162,22 @@ lto = true
panic = 'abort'
codegen-units = 1
[profile.test]
# Since we have many computationally expensive tests, this changes the test profile to
# compile with optimizations by default, but keep full debug info.
#
# This differs from the release profile in the following ways:
# - it does not set `lto = true`, which increases compile times without substantially
# speeding up tests;
# - it does not set `codegen-units = 1`, which increases compile times and is only
# useful to improve determinism of release builds;
# - it does not set `panic = 'abort'`, which is in any case ignored for tests.
#
# To get results as close as possible to a release build, use `cargo test --release`.
# To speed up compilation and avoid optimizations potentially resulting in lower-quality
# debug info, use `cargo test --profile=dev`.
opt-level = 3
debug = true
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(zcash_unstable, values("zfuture"))'] }