Skip to content

Commit c218075

Browse files
authored
Merge branch 'main' into master
2 parents 6f5f155 + 70b49c5 commit c218075

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6957
-1655
lines changed

.evergreen/Cargo.lock.msrv

Lines changed: 1057 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/check-clippy.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -o errexit
44

55
. ~/.cargo/env
6-
cargo clippy --all-targets --all-features -p bson -- -D warnings
76

8-
cd serde-tests && cargo clippy --all-targets --all-features -p serde-tests -- -D warnings
7+
# Pin clippy to the latest version. This should be updated when new versions of Rust are released.
8+
CLIPPY_VERSION=1.65.0
9+
10+
rustup install $CLIPPY_VERSION
11+
12+
cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p bson -- -D warnings
13+
14+
cd serde-tests
15+
cargo +$CLIPPY_VERSION clippy --all-targets --all-features -p serde-tests -- -D warnings

.evergreen/check-rustdoc.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -o errexit
44

55
. ~/.cargo/env
6-
cargo +nightly rustdoc -p bson --all-features -- --cfg docsrs -D warnings
6+
7+
cargo +nightly rustdoc -p bson --all-features -- --cfg docsrs -D warnings

.evergreen/check-rustfmt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -o errexit
44

.evergreen/compile-only.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -o errexit
44

55
. ~/.cargo/env
66
rustup update $RUST_VERSION
77

8+
# pin all dependencies when checking msrv compilation
9+
if [ "$MSRV" = "true" ]; then
10+
cp .evergreen/Cargo.lock.msrv Cargo.lock
11+
fi
12+
813
rustup run $RUST_VERSION cargo build

.evergreen/config.yml

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ functions:
9090
working_dir: "src"
9191
script: |
9292
${PREPARE_SHELL}
93-
RUST_VERSION=${RUST_VERSION} .evergreen/compile-only.sh
93+
RUST_VERSION=${RUST_VERSION} MSRV=${MSRV} .evergreen/compile-only.sh
9494
9595
"check rustfmt":
9696
- command: shell.exec
@@ -112,6 +112,17 @@ functions:
112112
${PREPARE_SHELL}
113113
.evergreen/check-clippy.sh
114114
115+
"run fuzzer":
116+
- command: shell.exec
117+
type: test
118+
params:
119+
shell: bash
120+
working_dir: "src"
121+
script: |
122+
${PREPARE_SHELL}
123+
.evergreen/install-fuzzer.sh
124+
.evergreen/run-fuzzer.sh
125+
115126
"check rustdoc":
116127
- command: shell.exec
117128
type: test
@@ -122,6 +133,16 @@ functions:
122133
${PREPARE_SHELL}
123134
.evergreen/check-rustdoc.sh
124135
136+
"run wasm tests":
137+
- command: shell.exec
138+
type: test
139+
params:
140+
shell: bash
141+
working_dir: "src"
142+
script: |
143+
${PREPARE_SHELL}
144+
.evergreen/run-wasm-tests.sh
145+
125146
"init test-results":
126147
- command: shell.exec
127148
params:
@@ -162,13 +183,22 @@ tasks:
162183
commands:
163184
- func: "check rustdoc"
164185

186+
- name: "run-fuzzer"
187+
commands:
188+
- func: "run fuzzer"
189+
190+
- name: "wasm-test"
191+
commands:
192+
- func: "run wasm tests"
193+
165194
axes:
166195
- id: "extra-rust-versions"
167196
values:
168197
- id: "min"
169-
display_name: "1.48 (minimum supported version)"
198+
display_name: "1.56 (minimum supported version)"
170199
variables:
171-
RUST_VERSION: "1.48.0"
200+
RUST_VERSION: "1.56.0"
201+
MSRV: "true"
172202
- id: "nightly"
173203
display_name: "nightly"
174204
variables:
@@ -191,6 +221,7 @@ buildvariants:
191221
- ubuntu1804-test
192222
tasks:
193223
- name: "compile-only"
224+
194225
-
195226
name: "lint"
196227
display_name: "Lint"
@@ -200,3 +231,19 @@ buildvariants:
200231
- name: "check-clippy"
201232
- name: "check-rustfmt"
202233
- name: "check-rustdoc"
234+
235+
-
236+
name: "fuzz"
237+
display_name: "Raw BSON Fuzzer"
238+
run_on:
239+
- ubuntu1804-test
240+
tasks:
241+
- name: "run-fuzzer"
242+
243+
-
244+
name: "wasm"
245+
display_name: "WASM"
246+
run_on:
247+
- ubuntu1804-test
248+
tasks:
249+
- name: "wasm-test"

.evergreen/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
rm -rf ~/.rustup
44
curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path

.evergreen/install-fuzzer.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
7+
cargo install cargo-fuzz

.evergreen/run-fuzzer.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
. ~/.cargo/env
6+
7+
cd fuzz
8+
9+
# each runs for a minute
10+
cargo +nightly fuzz run deserialize -- -rss_limit_mb=4096 -max_total_time=60
11+
cargo +nightly fuzz run raw_deserialize -- -rss_limit_mb=4096 -max_total_time=60
12+
cargo +nightly fuzz run iterate -- -rss_limit_mb=4096 -max_total_time=60

.evergreen/run-tests.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -o errexit
44

55
. ~/.cargo/env
6+
67
RUST_BACKTRACE=1 cargo test
7-
RUST_BACKTRACE=1 cargo test --features chrono-0_4,uuid-0_8
8+
RUST_BACKTRACE=1 cargo test --all-features
89

910
cd serde-tests
1011
RUST_BACKTRACE=1 cargo test

0 commit comments

Comments
 (0)