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

test: add PluginSystem.Configure() tests #143

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented Feb 9, 2022

WIP with ugly unformulated code until #135 is merged, but let me know if you have any suggestions

This could be merged before #135 now. Either way there will be conflicts so doesn't matter which merges first 🤷

This PR currently includes #150

@jbedard jbedard requested a review from f0rmiga February 9, 2022 23:42
pkg/plugin/system/system.go Outdated Show resolved Hide resolved
@jbedard jbedard marked this pull request as ready for review February 11, 2022 21:58
@jbedard jbedard force-pushed the plugin-configure-tests branch 4 times, most recently from 9b146c3 to dacbf03 Compare February 14, 2022 17:59
pkg/plugin/system/system.go Outdated Show resolved Hide resolved
pkg/plugin/system/system.go Outdated Show resolved Hide resolved
pkg/plugin/system/system_test.go Outdated Show resolved Hide resolved
@jbedard jbedard force-pushed the plugin-configure-tests branch 5 times, most recently from 4a05219 to 8e65f30 Compare February 15, 2022 00:25
@jbedard jbedard force-pushed the plugin-configure-tests branch 7 times, most recently from 5819d20 to 5bcc9fa Compare February 17, 2022 01:34
@jbedard jbedard requested a review from f0rmiga February 17, 2022 01:34
@jbedard jbedard force-pushed the plugin-configure-tests branch 2 times, most recently from 32d689d to 9d8658f Compare February 24, 2022 22:37
pkg/plugin/system/system_test.go Outdated Show resolved Hide resolved
pkg/plugin/system/system_test.go Outdated Show resolved Hide resolved
pkg/plugin/system/system_test.go Outdated Show resolved Hide resolved
pkg/plugin/system/system_test.go Outdated Show resolved Hide resolved
}

p1 := plugin_mock.NewMockPlugin(ctrl)
p1.EXPECT().Setup(gomock.Any())
Copy link
Contributor

Choose a reason for hiding this comment

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

In a follow-up PR, it would be nice to be explicit about what the Setup takes. I.e. testing that it's getting called with the expected args.

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've updated some of them, but this specific one accepts an array of bytes which is pretty awkward. I think I'd only want to verify the bytes are correct in a test explicitly testing that, to avoid the "data => bytes" logic being repeated everywhere.

var stdout strings.Builder
streams := ioutils.Streams{Stdout: &stdout, Stderr: &stdout}

pluginProperties := make(map[string]interface { // foo: {},
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove comment?

@f0rmiga f0rmiga merged commit 1ceed7f into aspect-build:main Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants