Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make full the default for third-party tests #1362

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions necessist/tests/third_party_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use std::{
fmt::Write as _,
fs::{read_dir, read_to_string, remove_file, write},
io::{stderr, Read, Write},
ops::Not,
panic::{set_hook, take_hook},
path::{Path, PathBuf},
process::{exit, Command},
Expand Down Expand Up @@ -79,10 +80,10 @@ struct Test {
#[serde(default)]
source_files: Vec<String>,

/// If false (the default), Necessist dumps removal candidates and exits (i.e.,
/// --dump-candidates is passed to Necessist); if true, Necessist is run with --verbose
/// If true, Necessist dumps removal candidates and exits (i.e., --dump-candidates is passed to
/// Necessist); if false (the default), Necessist is run with --verbose
#[serde(default)]
full: bool,
parsing_only: bool,

/// Additional arguments to pass to Necessist; appended at the end of the command
#[serde(default)]
Expand Down Expand Up @@ -519,10 +520,10 @@ fn run_test(tempdir: &Path, path: &Path, test: &Test) -> (String, Duration) {
if let Some(framework) = &test.framework {
exec = exec.args(&["--framework", framework]);
}
if test.full {
exec = exec.arg("--verbose");
} else {
if test.parsing_only {
exec = exec.arg("--dump-candidates");
} else {
exec = exec.arg("--verbose");
}
for source_file in &test.source_files {
exec = exec.arg(
Expand Down Expand Up @@ -587,7 +588,7 @@ fn run_test(tempdir: &Path, path: &Path, test: &Test) -> (String, Duration) {

if test.check_sqlite_urls {
assert!(test.rev.is_some());
assert!(test.full);
assert!(!test.parsing_only);
check_sqlite_urls(tempdir, &root, test);
}
}
Expand Down Expand Up @@ -790,7 +791,7 @@ fn readme_is_current() {
name.to_string_lossy(),
test.rev.map(|s| s + " ").unwrap_or_default(),
test.framework.map(|s| s + " ").unwrap_or_default(),
test.full.to_x_space(),
test.parsing_only.not().to_x_space(),
target_os_includes(test.target_os.as_ref(), "linux").to_x_space(),
target_os_includes(test.target_os.as_ref(), "macos").to_x_space(),
target_os_includes(test.target_os.as_ref(), "windows").to_x_space(),
Expand Down
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/0/chainlink.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
url = "https://github.com/smartcontractkit/chainlink"
rev = "v2.18.0"
parsing_only = true
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ url = "https://github.com/smartcontractkit/chainlink"
rev = "v2.18.0"
subdir = "contracts"
framework = "hardhat"
parsing_only = true

[config]
ignored_functions = ["bigNumEquals", "evmRevert"]
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/0/crates_io.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# without `src` directories, and `src` directories with `tests` subdirectories.
url = "https://github.com/rust-lang/crates.io"
rev = "5643e3fb5d53d3b8cc5620d583068ae17e82b5c3"
parsing_only = true
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
url = "https://github.com/golang/go"
rev = "go1.23.0"
framework = "go"
full = true

subdir = "src/encoding/base64"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ rev = "go1.23.0"
target_os = ["linux", "macos"]

framework = "go"
full = true

subdir = "src/encoding/binary"
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/0/go_src_mime.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ url = "https://github.com/golang/go"
rev = "go1.23.0"
target_os = ["linux", "macos"]
framework = "go"
full = true
config_mandatory = true

subdir = "src/mime"
Expand Down
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/0/go_src_net_url.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
url = "https://github.com/golang/go"
rev = "go1.23.0"
framework = "go"
full = true

subdir = "src/net/url"
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/0/go_src_os.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ target_os = ["linux", "macos"]
subdir = "src/os"
framework = "go"
source_files = ["os_test.go"]
full = true
config_mandatory = true

[config]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
url = "https://github.com/ProjectOpenSea/operator-filter-registry"
rev = "v1.4.2"
parsing_only = true

[config]
ignored_functions = ["vm.prank", "vm.startPrank", "vm.stopPrank"]
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/0/proptest_https.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ url = "https://github.com/proptest-rs/proptest"
rev = "b71253807372932f72a71b1af7975371a41e7c88"
subdir = "proptest"
source_files = ["src/sample.rs"]
full = true
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/0/pyth.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ url = "https://github.com/pyth-network/pyth-crosschain"
target_os = ["linux", "macos"]
subdir = "pythnet/message_buffer"
framework = "anchor"
parsing_only = true
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/0/uniswap_v3-core.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
url = "https://github.com/Uniswap/v3-core"
parsing_only = true

[config]
ignored_functions = ["checkObservationEquals", "snapshotGasCost"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ rev = "v2.18.0"
subdir = "contracts"
framework = "foundry"
source_files = ["src/v0.8/transmission/test/EIP_712_1014_4337.t.sol"]
full = true

[config]
ignored_functions = ["vm.prank", "vm.startPrank", "vm.stopPrank"]
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/1/diem.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://www.reddit.com/r/rust/comments/s6olun/comment/ht5l2kj
url = "https://github.com/diem/diem"
rev = "diem-core-v1.4.4"
parsing_only = true
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/1/go_src_os_user.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
url = "https://github.com/golang/go"
rev = "go1.23.0"
framework = "go"
full = true
config_mandatory = true

subdir = "src/os/user"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
url = "https://github.com/golang/go"
rev = "go1.23.0"
framework = "go"
full = true

subdir = "src/testing/iotest"
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
url = "https://github.com/golang/go"
rev = "go1.23.0"
framework = "go"
full = true

subdir = "src/text/template/parse"
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/1/minio.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# https://blog.kowalczyk.info/article/9afe3485f2204f1bb43217d70f7b87d4/big-projects-written-in-go.html
url = "https://github.com/minio/minio"
rev = "RELEASE.2024-11-07T00-52-20Z"
parsing_only = true
1 change: 0 additions & 1 deletion necessist/tests/third_party_tests/1/proptest_ssh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ url = "[email protected]:proptest-rs/proptest"
rev = "b71253807372932f72a71b1af7975371a41e7c88"
subdir = "proptest"
source_files = ["src/sample.rs"]
full = true
1 change: 1 addition & 0 deletions necessist/tests/third_party_tests/1/seaport.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
url = "https://github.com/ProjectOpenSea/seaport"
rev = "1.6"
framework = "hardhat"
parsing_only = true

[config]
ignored_functions = ["checkExpectedEvents"]
2 changes: 0 additions & 2 deletions necessist/tests/third_party_tests/1/squads-protocol_v4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ source_files = [
"tests/suites/examples/immediate-execution.ts",
]

full = true

args = [
"--allow=instrumentation-nonbuildable",
"--",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
url = "https://github.com/Uniswap/v3-core"
source_files = ["test/UniswapV3Factory.spec.ts"]
full = true