Skip to content

Commit 2c01747

Browse files
committed
Remove verbose output and add logs
It should be easier to see why a test was wrong reading the logs. The verbose output of the cargo commands is only needed when things do not compile. To not enable logging on stress tests, the environment variables are used. Signed-off-by: Hugues de Valon <[email protected]>
1 parent 05fe3b1 commit 2c01747

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

tests/all_providers/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[core_settings]
2-
log_level = "error"
32
# The CI already timestamps the logs
43
log_timestamp = false
54

tests/ci.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fi
8989
##############
9090
# Build test #
9191
##############
92-
RUST_BACKTRACE=1 cargo build -vv $FEATURES
92+
RUST_BACKTRACE=1 cargo build $FEATURES
9393

9494
#################
9595
# Static checks #
@@ -101,7 +101,7 @@ then
101101
fi
102102
if rustup component list | grep -q clippy
103103
then
104-
cargo clippy --all-targets $FEATURES -- -D warnings
104+
cargo clippy --all-targets $FEATURES -- -D clippy::all
105105
fi
106106

107107
############################
@@ -113,26 +113,26 @@ RUST_BACKTRACE=1 cargo test --doc $FEATURES
113113
######################################
114114
# Start Parsec for integration tests #
115115
######################################
116-
RUST_BACKTRACE=1 cargo run -vv $FEATURES -- --config $CONFIG_PATH &
116+
RUST_LOG=info RUST_BACKTRACE=1 cargo run $FEATURES -- --config $CONFIG_PATH &
117117
SERVER_PID=$!
118118
# Sleep time needed to make sure Parsec is ready before launching the tests.
119119
sleep 5
120120

121121
if [[ $1 = "all" ]]
122122
then
123123
# All providers tests
124-
RUST_BACKTRACE=1 cargo test -vv $FEATURES all_providers
124+
RUST_BACKTRACE=1 cargo test $FEATURES all_providers
125125
else
126126
# Per provider tests
127127
################
128128
# Normal tests #
129129
################
130-
RUST_BACKTRACE=1 cargo test -vv $FEATURES normal_tests
130+
RUST_BACKTRACE=1 cargo test $FEATURES normal_tests
131131

132132
#####################
133133
# Persistence tests #
134134
#####################
135-
RUST_BACKTRACE=1 cargo test -vv $FEATURES persistent-before
135+
RUST_BACKTRACE=1 cargo test $FEATURES persistent-before
136136

137137
# Create a fake mapping file for the root application, the provider and a
138138
# key name of "Test Key". It contains a valid PSA Key ID.
@@ -152,13 +152,25 @@ else
152152

153153
# Trigger a configuration reload to load the new mappings.
154154
kill -s SIGHUP $SERVER_PID
155+
# Sleep time needed to make sure Parsec is ready before launching the tests.
156+
sleep 5
157+
158+
RUST_BACKTRACE=1 cargo test $FEATURES persistent-after
155159

156-
RUST_BACKTRACE=1 cargo test -vv $FEATURES persistent-after
160+
kill $SERVER_PID
161+
# Sleep time needed to make sure Parsec is killed.
162+
sleep 2
157163

158164
################
159165
# Stress tests #
160166
################
161-
RUST_BACKTRACE=1 cargo test -vv $FEATURES stress_test
167+
# Change the log level for the stress tests because logging is limited on the
168+
# CI servers.
169+
RUST_LOG=error RUST_BACKTRACE=1 cargo run $FEATURES -- --config $CONFIG_PATH &
170+
SERVER_PID=$!
171+
sleep 5
172+
173+
RUST_BACKTRACE=1 cargo test $FEATURES stress_test
162174
fi
163175

164176
kill $SERVER_PID

tests/per_provider/provider_cfg/mbed-crypto/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[core_settings]
2-
log_level = "error"
32
# The CI already timestamps the logs
43
log_timestamp = false
54

tests/per_provider/provider_cfg/pkcs11/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[core_settings]
2-
log_level = "error"
32
# The CI already timestamps the logs
43
log_timestamp = false
54

tests/per_provider/provider_cfg/tpm/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[core_settings]
2-
log_level = "error"
32
# The CI already timestamps the logs
43
log_timestamp = false
54

0 commit comments

Comments
 (0)