Skip to content

Sampling a gem via its test suite #4

Open
@stevegeek

Description

Currently when adding type_fusion to a test suite of a gem, no samples are captured for the gem under test, as the sampler only selects any files that are in the gem_path https://github.com/marcoroth/type_fusion/blob/main/lib/type_fusion/sampler.rb#L137.

I guess this is so that only gems that are released to rubygems are sampled, but running the test suite of a gem itself seems like a nice way to collect type info, rather that needing an application or script as a sort of harness to exercise the gem in.

I managed to sample a gem via running its test suite, by simply modifying the test helper to require the released and installed gem, rather than including the local lib/ directory.

However while messing around trying to get the sampling to work I seem to have also sent samples for the test classes themselves, sorry about that. See https://gem.sh/gems/typed_operation/v1.0.0.pre3/types .. would it be possible to reject any samples for code that is defined in files that are not in the actual build/released gem?

This gem is a very neat idea!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions