Skip to content

Commit

Permalink
fix: actually run all unit tests in CI (#6989)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Feb 1, 2024
1 parent f5af8d6 commit 996c643
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/matrices.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(
config = [
Case(
name="unit",
filter="kind(lib) | kind(bench) | kind(proc-macro)",
filter="!kind(test)",
n_partitions=1,
pr_cross_platform=True,
),
Expand Down
8 changes: 4 additions & 4 deletions crates/cast/bin/cmd/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ mod tests {
#[test]
fn can_parse_call_data() {
let data = hex::encode("hello");
let args: CallArgs =
CallArgs::parse_from(["foundry-cli", "--data", format!("0x{data}").as_str()]);
assert_eq!(args.data, Some(data.clone()));
let args = CallArgs::parse_from(["foundry-cli", "--data", data.as_str()]);
assert_eq!(args.data, Some(data));

let args: CallArgs = CallArgs::parse_from(["foundry-cli", "--data", data.as_str()]);
let data = hex::encode_prefixed("hello");
let args = CallArgs::parse_from(["foundry-cli", "--data", data.as_str()]);
assert_eq!(args.data, Some(data));
}

Expand Down
1 change: 1 addition & 0 deletions crates/forge/bin/cmd/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ mod tests {
use tempfile::tempdir;

#[test]
#[ignore = "slow"]
fn get_oz_tags() {
let tmp = tempdir().unwrap();
let git = Git::new(tmp.path());
Expand Down
33 changes: 13 additions & 20 deletions crates/forge/bin/cmd/script/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,21 +703,14 @@ mod tests {

#[test]
fn can_parse_sig() {
let args: ScriptArgs = ScriptArgs::parse_from([
"foundry-cli",
"Contract.sol",
"--sig",
"0x522bb704000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfFFb92266",
]);
assert_eq!(
args.sig,
"522bb704000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfFFb92266"
);
let sig = "0x522bb704000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfFFb92266";
let args = ScriptArgs::parse_from(["foundry-cli", "Contract.sol", "--sig", sig]);
assert_eq!(args.sig, sig);
}

#[test]
fn can_parse_unlocked() {
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"Contract.sol",
"--sender",
Expand All @@ -741,7 +734,7 @@ mod tests {

#[test]
fn can_merge_script_config() {
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"Contract.sol",
"--etherscan-api-key",
Expand All @@ -753,7 +746,7 @@ mod tests {

#[test]
fn can_parse_verifier_url() {
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"script",
"script/Test.s.sol:TestScript",
Expand All @@ -775,7 +768,7 @@ mod tests {

#[test]
fn can_extract_code_size_limit() {
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"script",
"script/Test.s.sol:TestScript",
Expand Down Expand Up @@ -803,7 +796,7 @@ mod tests {

let toml_file = root.join(Config::FILE_NAME);
fs::write(toml_file, config).unwrap();
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"Contract.sol",
"--etherscan-api-key",
Expand Down Expand Up @@ -831,7 +824,7 @@ mod tests {

let toml_file = root.join(Config::FILE_NAME);
fs::write(toml_file, config).unwrap();
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"DeployV1",
"--rpc-url",
Expand Down Expand Up @@ -870,7 +863,7 @@ mod tests {

let toml_file = root.join(Config::FILE_NAME);
fs::write(toml_file, config).unwrap();
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"DeployV1",
"--rpc-url",
Expand Down Expand Up @@ -915,7 +908,7 @@ mod tests {

let toml_file = root.join(Config::FILE_NAME);
fs::write(toml_file, config).unwrap();
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"DeployV1",
"--rpc-url",
Expand Down Expand Up @@ -943,15 +936,15 @@ mod tests {
// <https://github.com/foundry-rs/foundry/issues/5923>
#[test]
fn test_5923() {
let args: ScriptArgs =
let args =
ScriptArgs::parse_from(["foundry-cli", "DeployV1", "--priority-gas-price", "100"]);
assert!(args.priority_gas_price.is_some());
}

// <https://github.com/foundry-rs/foundry/issues/5910>
#[test]
fn test_5910() {
let args: ScriptArgs = ScriptArgs::parse_from([
let args = ScriptArgs::parse_from([
"foundry-cli",
"--broadcast",
"--with-gas-price",
Expand Down
4 changes: 2 additions & 2 deletions crates/forge/bin/cmd/verify/etherscan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ mod tests {
&config,
)
.unwrap();
assert_eq!(client.etherscan_api_url().as_str(), "https://api-testnet.polygonscan.com/?/");
assert_eq!(client.etherscan_api_url().as_str(), "https://api-testnet.polygonscan.com/");

assert!(format!("{client:?}").contains("dummykey"));

Expand All @@ -539,7 +539,7 @@ mod tests {
&config,
)
.unwrap();
assert_eq!(client.etherscan_api_url().as_str(), "https://verifier-url.com/?/");
assert_eq!(client.etherscan_api_url().as_str(), "https://verifier-url.com/");
assert!(format!("{client:?}").contains("dummykey"));
}

Expand Down

0 comments on commit 996c643

Please sign in to comment.