Remove proptests for nuon writing/parsing (#8688)

# Description

The two tests `to_nuon_from_nuon` and `to_nuon_from_nuon_string` were
taking multiple seconds and have since been superseded by more explicit
unit tests. Compared to the time cost for devs and CI they seldomly
returned explicit problems. One failure only popped up after months, as
a sampled failure (https://github.com/nushell/nushell/pull/7564).


# User-Facing Changes

none

# Tests + Formatting

Fuzzing should move to a separate worker and be removed from the main
test suite.
See #8575 for experimentation around the impact on our test coverage.
This commit is contained in:
Stefan Holderbach 2023-03-31 17:15:16 +02:00 committed by GitHub
parent 8a85299575
commit 3bf5999ef4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1 additions and 118 deletions

57
Cargo.lock generated
View File

@ -2848,7 +2848,6 @@ dependencies = [
"polars",
"powierza-coefficient",
"print-positions",
"proptest",
"quick-xml 0.28.1",
"quickcheck",
"quickcheck_macros",
@ -4053,27 +4052,6 @@ dependencies = [
"rustix",
]
[[package]]
name = "proptest"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70"
dependencies = [
"bit-set",
"bitflags",
"byteorder",
"lazy_static",
"num-traits",
"quick-error 2.0.1",
"rand 0.8.5",
"rand_chacha 0.3.1",
"rand_xorshift",
"regex-syntax",
"rusty-fork",
"tempfile",
"unarray",
]
[[package]]
name = "pure-rust-locales"
version = "0.5.6"
@ -4096,12 +4074,6 @@ version = "1.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
[[package]]
name = "quick-error"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
[[package]]
name = "quick-xml"
version = "0.25.0"
@ -4243,15 +4215,6 @@ dependencies = [
"rand_core 0.5.1",
]
[[package]]
name = "rand_xorshift"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
dependencies = [
"rand_core 0.6.4",
]
[[package]]
name = "rayon"
version = "1.7.0"
@ -4496,18 +4459,6 @@ version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06"
[[package]]
name = "rusty-fork"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f"
dependencies = [
"fnv",
"quick-error 1.2.3",
"tempfile",
"wait-timeout",
]
[[package]]
name = "ryu"
version = "1.0.13"
@ -5018,7 +4969,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36e39da5d30887b5690e29de4c5ebb8ddff64ebd9933f98a01daaa4fd11b36ea"
dependencies = [
"peresil",
"quick-error 1.2.3",
"quick-error",
"sxd-document",
]
@ -5482,12 +5433,6 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46b0c16eadfb312c7acd6970fc97d1f3152eb536714a2ff72ca09a92cae6fa67"
[[package]]
name = "unarray"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94"
[[package]]
name = "unicase"
version = "2.6.0"

View File

@ -162,7 +162,6 @@ mockito = "1.0.0"
dirs-next = "2.0.0"
hamcrest2 = "0.3.0"
proptest = "1.1.0"
quickcheck = "1.0.3"
quickcheck_macros = "1.0.0"
rstest = { version = "0.17.0", default-features = false }

View File

@ -1,24 +0,0 @@
# Seeds for failure cases proptest has generated in the past. It is
# automatically read and these particular cases re-run before any
# novel cases are generated.
#
# It is recommended to check this file in to source control so that
# everyone who runs the test benefits from these saved cases.
cc 96a80ecd19729fb43a7b7bb2766b37d6083ba73b16abb97075875e3cfcdc763f # shrinks to c = '"'
cc 4146602559ea717a02bcef3c6d73cdf613c30d0c3f92c48e26c79b9a1544e027 # shrinks to c = '\\'
cc 80532a0ee73df456a719b9e3cce1ae5f3d26009dde819cbaf16f8e0cb6709705 # shrinks to c = ':'
cc cdb88505686eea3c74c36f282fd29b2b68bc118ded4ebfc36f9838d174bd7653 # shrinks to c = '`'
cc 0f534d55f9771e8810b9c4252a4168abfaec1a35e1b0cac12dbaf726d295a08c # shrinks to c = '\0'
cc 5d31bcbab722acd1f4e23ca3a4f95ff309a636b45a73ca8ae9f820d93ff57acc # shrinks to c = '{'
cc 5afec063bc96160d681d77f90041b67ef5cfdea4dcbd12d984fd828fbeb4b421 # shrinks to c = '#'
cc f919beb3ee5c70e756a15635d65ded7d44f3ae58b5e86b6c09e814d5d8cdd506 # shrinks to c = ';'
cc ec00f39b8d45dfd8808947a56af5e50ba5a0ef7c951723b45377815a02e515b1 # shrinks to c = '('
cc 25b773cdf4c24179151fa86244c7de4136e05df9e94e6ee77a336ebfd8764444 # shrinks to c = '|'
cc 94dc0d54b97d59e1c0f4cb11bdccb3823a1bb908cbc3fd643ee8f067169fad72 # shrinks to c = '0'
cc c9d0051fb1e5a8bdc1d4f5a3dceac1b4b465827d1dff4fc3a3755baae6a7bb48 # shrinks to c = '$'
cc 14ec40d2eb5bd2663e9b11bb49fb2120852f9ea71678c69d732161412b55a3ec # shrinks to s = ""
cc d4afccc51ed9d421bdb7e1723e273dfb6e77c3a449489671a496db234e87c5ed # shrinks to c = '\r'
cc 515a56d73eb1b69290ef4c714b629421989879aebd57991bd2c2bf11294353b1 # shrinks to s = "\\\\𐊀{"
cc 111566990fffa432acd2dbc845141b0e7870f97125c7621e3ddf142204568246 # shrinks to s = "'\":`"
cc 0424c33000d9188be96b3049046eb052770b2158bf5ebb0c98656d7145e8aca9 # shrinks to s = "0"
cc 39026f9657675bde623b9710c6fa113dee418142d0c25733b0798102948d0213 # shrinks to s = "}𐀋⋆"

View File

@ -1,5 +1,4 @@
use nu_test_support::{nu, pipeline};
use proptest::prelude::*;
#[test]
fn to_nuon_correct_compaction() {
@ -503,39 +502,3 @@ fn read_code_should_fail_rather_than_panic() {
));
assert!(actual.err.contains("error when parsing"))
}
proptest! {
#[test]
fn to_nuon_from_nuon(c: char) {
if c != '\0' && c!='\r' {
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
format!(r#"
{{"prop{c}test": "sam"}} | to nuon | from nuon;
[ [ "prop{c}test" ]; [ 'test' ] ] | to nuon | from nuon;
[ [ "{c}" ]; [ 'test' ] ] | to nuon | from nuon;
{{"{c}": "sam"}} | to nuon | from nuon;
"#).as_ref()
));
assert!(actual.err.is_empty() || actual.err.contains("Unexpected end of code") || actual.err.contains("only strings can be keys") || actual.err.contains("unbalanced { and }"));
// The second is for weird escapes due to backslashes
// The third is for chars like '0'
}
}
#[test]
fn to_nuon_from_nuon_string(s: String) {
if s != "\\0" && !s.is_empty() && !s.contains('\\') && !s.contains('"'){
let actual = nu!(
cwd: "tests/fixtures/formats", pipeline(
format!(r#"
{{"prop{s}test": "sam"}} | to nuon | from nuon;
[ [ "prop{s}test" ]; [ 'test' ] ] | to nuon | from nuon;
[ [ "{s}" ]; [ 'test' ] ] | to nuon | from nuon;
{{"{s}": "sam"}} | to nuon | from nuon;
"#).as_ref()
));
assert!(actual.err.is_empty() || actual.err.contains("only strings can be keys") || actual.err.contains("unknown command"));
// TODO: fix parser error for "unknown command" when '=$' is the name
}
}
}