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

Plugin Development Framework #4324

Merged
merged 9 commits into from
Jul 2, 2018
Merged

Plugin Development Framework #4324

merged 9 commits into from
Jul 2, 2018

Conversation

Ayrdrie
Copy link
Contributor

@Ayrdrie Ayrdrie commented Jun 20, 2018

Resolves #4321

  • Signed CLA.
  • Associated CONTRIBUTING.md updated.

@phemmer
Copy link
Contributor

phemmer commented Jun 21, 2018

Just my own $0.02 as a developer who frequently contributes: I think docker should only be used when we need to create an integration test with an external service that cannot be mocked. I personally don't want to have to install & launch docker just to perform a test that could be accomplished with go test. Like why does logparser need a docker container?

@danielnelson
Copy link
Contributor

I think we should be careful to differentiate between testing and development.

Tests should use the method that adds as few dependencies and confounding factors as possible. This means favoring unittests over integration tests. Unittests should allow greater control over the test environment, pinpoint the cause of the error more accurately, are less likely to fail spuriously, and are faster to run. Integration tests, in addition to not doing those things as well, aren't ran as part of continuous integration.

I don't see this pattern being used as part of the automated tests, but it could be useful for development.

Developing plugins often requires running the real service in order to write the behavior for mocks into the unittests, and I think this is where docker can be helpful. But, like testing, development should still use the simplest method available. In the case of plugins like logparser, it doesn't make much sense to develop with docker, and we don't want it a requirement for testing. There are other situations where docker won't be helpful either, such as if you need to test a problem on a platform that is not Linux or if the service is not Free Software.

With this philosophy, I think we should reword things so that they are more development focused. It should be made clear that the docker compose files are recommended for development and that it is optional to add docker compose file when adding a new plugin.

@glinton glinton changed the title Plugin Test Framework Plugin Development Framework Jun 25, 2018
@glinton glinton mentioned this pull request Jun 26, 2018
3 tasks
@danielnelson danielnelson added this to the 1.8.0 milestone Jul 2, 2018
@danielnelson danielnelson merged commit 9fe90d7 into master Jul 2, 2018
@danielnelson danielnelson deleted the feature/4321 branch July 2, 2018 23:34
rgitzel pushed a commit to rgitzel/telegraf that referenced this pull request Oct 17, 2018
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
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.

4 participants