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

Part 1 - reorganize xcresult test fixtures #299

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

dfrankland
Copy link
Member

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.

Copy link

trunk-io bot commented Jan 15, 2025

😎 Merged successfully - details.

Copy link

trunk-staging-io bot commented Jan 15, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link
Member Author

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.

Copy link
Member Author

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

Comment on lines 22 to -32
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),
}
}
Copy link
Member Author

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"
Copy link
Collaborator

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.

Copy link
Member Author

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.

@trunk-io trunk-io bot merged commit f4d83cd into main Jan 15, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants