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

Extend finding components to plugins and executables distributed by forc #666

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

alfiedotwtf
Copy link
Contributor

When checking if a component is distributed by forc, we currently only look at forc's direct executables. This needs to be extended to resolve components, plugins, and executables.

This fixes a few issues found while investigating #665.

@alfiedotwtf alfiedotwtf added bug Something isn't working code quality fuelup labels Oct 4, 2024
@alfiedotwtf alfiedotwtf requested a review from a team October 4, 2024 07:16
@alfiedotwtf alfiedotwtf self-assigned this Oct 4, 2024
@fuel-service-user
Copy link
Contributor

fuel-service-user commented Oct 4, 2024

LCOV of commit abea586 during CI #2081

Summary coverage rate:
  lines......: 85.9% (2464 of 2869 lines)
  functions..: 46.0% (382 of 831 functions)
  branches...: 62.9% (287 of 456 branches)

Files changed coverage rate: n/a

@alfiedotwtf alfiedotwtf marked this pull request as draft October 22, 2024 00:07
@alfiedotwtf alfiedotwtf changed the title Extend finding components to plugins and executables distributed by forc (#652) Extend finding components to plugins and executables distributed by forc Oct 27, 2024
@alfiedotwtf alfiedotwtf marked this pull request as ready for review October 27, 2024 16:47
Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps we could consider adding 2 more tests here.

#[test]
fn test_resolve_from_name_nonexistent() {
    assert!(Component::resolve_from_name("nonexistent-component").is_none());
}

#[test]
fn test_resolve_from_name_case_sensitivity() {
    let original = Component::resolve_from_name("forc");
    let uppercase = Component::resolve_from_name("FORC");
    assert_ne!(original, uppercase);
}

@alfiedotwtf
Copy link
Contributor Author

perhaps we could consider adding 2 more tests here.

Nice!

…orc (#654)

When checking if a component is distributed by forc, we currently only
look at forc's direct executables. This needs to be extended to resolve
components, plugins, and executables.
@alfiedotwtf alfiedotwtf merged commit 1b801e6 into master Oct 28, 2024
17 checks passed
@alfiedotwtf alfiedotwtf deleted the alfie/is_distributed branch October 28, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code quality fuelup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants