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

pkg/testutil: add in-memory Plugin builder #283

Merged
merged 1 commit into from
Jul 21, 2019

Commits on Jul 21, 2019

  1. pkg/testutil: add in-memory Plugin builder

    Introducing builder-pattern methods to create in-memory Plugin/Platform objects
    that has good defaults, but can be overwritten for test purposes. Readability
    of the test files (e.g. validation/*_test.go) now speak for themselves.
    
    The testutil.NewPlugin() returns a _valid_ index.Plugin instance. Any tests
    expected to fail can modify its values with the builder pattern. (ditto for
    testutil.NewPlatform()).
    
    - had to move validation code to pkg/index/validation due to a cyclic
      import situation that occurred. This should be fine.
    - renamed some test cases for ease of readability
    - I've thought about adding code validation for **_test.go to not to have any
      index.Plugin{ or index.Platform{ strings. But this might be an overkill atm.
    
    Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
    ahmetb committed Jul 21, 2019
    Configuration menu
    Copy the full SHA
    ffea965 View commit details
    Browse the repository at this point in the history