-
Notifications
You must be signed in to change notification settings - Fork 3
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
Part 1 - reorganize xcresult test fixtures #299
Conversation
😎 Merged successfully - details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reiterate the PR description, I think having the XML plain text in the repo will help with reviews and track changes to output overtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Archiving the individual .xcresult
bundles will likely cause less churn since we don't need to update the individual bundles
lazy_static! { | ||
static ref TEMP_DIR: TempDir = TempDir::default(); | ||
static ref TEMP_DIR_TEST_1: TempDir = | ||
unpack_archive_to_temp_dir("tests/data/test1.xcresult.tar.gz"); | ||
static ref TEMP_DIR_TEST_3: TempDir = | ||
unpack_archive_to_temp_dir("tests/data/test3.xcresult.tar.gz"); | ||
static ref TEMP_DIR_TEST_4: TempDir = | ||
unpack_archive_to_temp_dir("tests/data/test4.xcresult.tar.gz"); | ||
static ref TEMP_DIR_TEST_EXPECTED_FAILURES: TempDir = | ||
unpack_archive_to_temp_dir("tests/data/test-ExpectedFailures.xcresult.tar.gz"); | ||
static ref REPO: RepoUrlParts = RepoUrlParts { | ||
host: "github.com".to_string(), | ||
owner: "trunk-io".to_string(), | ||
name: "analytics-cli".to_string() | ||
}; | ||
} | ||
|
||
#[cfg(test)] | ||
#[ctor] | ||
fn init() { | ||
let path = "tests/data.tar.gz"; | ||
let file = File::open(path).unwrap(); | ||
let decoder = GzDecoder::new(file); | ||
let mut archive = Archive::new(decoder); | ||
match archive.unpack(TEMP_DIR.as_ref()) { | ||
Ok(_) => (), | ||
Err(e) => panic!("failed to unpack data.tar.gz: {}", e), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think ctor
gets us any more functionality than what lazy_static
already allows, which is to lazily initialize anything and stick it in a static reference. Let me know if this is off and there's something more I'm not seeing.
@@ -25,7 +25,6 @@ serde_json = "1.0.133" | |||
uuid = { version = "1.10.0", features = ["v5"] } | |||
|
|||
[dev-dependencies] | |||
ctor = "0.2.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any nice tools for automatically finding unused deps? I tried a couple but they ended up breaking builds by mis-identifying unused dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't used any personally—you probably know more than I do.
I did this to clean up a few things, but more importantly to track changes to fixtures in git. I believe this will help with reviews and to track changes to output over time.