mockito / shipkit

Toolkit for shipping it used by Mockito library
http://shipkit.org
MIT License
158 stars 35 forks source link

Automated e2e testing and pushing version upgrades to consumers #85

Open mockitoguy opened 7 years ago

mockitoguy commented 7 years ago

Producer-client lifecycle

Above are the problems of the challenges of the producer-client lifecycle. Let's figure out a set of plugins an features that will streamline evolution and adoption of new versions.

Suggested implementation

Let's try to identify a scalable solution that can evolve into a general-purspose feature that allows convenient evolution of versions of OSS libraries. Below is the result of our internal discussions with @mstachniuk and @wwilk:

  1. In producer (mockito-release-tools) we can configure a list of “clients” we care about most. We would start with 2: (mockito + mockito-release-tools-example).
  2. For each client we provide a way to locally run e2e test with that client. For example: “./gradlew e2eTest” will run all clients, “./gradlew e2eTests:mockito:e2eTest” will run only e2eTest for Mockito client. e2e test is a) shallow clone b) bump version of producer to locally built c) performRelease -Preleasing.dryRun
  3. Running “build” includes running all “e2eTest” tasks. So if one of the clients is broken the build fails and there is no release on CI.
  4. When CI job is successful and we publish new version of producer we automatically create PR in GitHub for each client. The PR contains the version bump of the producer. For some clients we may choose not to publish PRs, those clients will be used only for e2e testing.
  5. Bonus: we can add a functionality that will make the CI job of the producer automatically merge the PR created for the client. We would use it for some clients, like “example" projects. We don’t want to use it for Mockito, the Mockito team will decide whether they want to merge or not. So the “wait for PR and automatically merge” functionality needs to be configurable per client.

Suggested solution would scale because

Starting point

To get started, let's get a single client local e2e test (example project) hooked up in the release-tools project. For version bumping, we can use Mockito's pattern of keeping the version of tools in gradle.properties file.

Future

In future this could potentially turn into more general capability we would add to release tools. It would be great if clients of release automation could automatically validate if their changes work with selected open source projects on GitHub. For example, I would love if every change of Mockito was tested with some other GitHub projects like guava. This potentially can be extremely useful feature.

mockitoguy commented 7 years ago

@mstachniuk, how does this one sound? Check out the "future" section, this feature can turn out into something huge!!!

mstachniuk commented 7 years ago

It sounds great! It's a huge. Let's maybe starts from something simpler. New successful release of mockito-release-tools automatically bump version of tool in mockito-release-tools-example, make some small change and release it! @szczepiq What do you think?

szpak commented 7 years ago

👍

I've implemented automated E2E smoke testing in my gradle-nexus-staging-plugin and I feel much more relaxed releasing new versions. Having those testing automated is crucial to provide reliable Continuous Delivery.

szpak commented 7 years ago

It would be great if clients of release automation could automatically validate if their changes work with selected open source projects on GitHub.

@szczepiq Again, we share the vision of the future of CD :)

mockitoguy commented 7 years ago

@szpak, we share the vision, now it's time to start working together :) Join us and we'll be unstoppable! 4 of us cranking great release automation toolkit!!!

https://github.com/Codearte/gradle-nexus-staging-plugin is a great plugin. We could merge our efforts :)

mockitoguy commented 7 years ago

Let's maybe starts from something simpler. New successful release of mockito-release-tools automatically bump version of tool in mockito-release-tools-example, make some small change and release it! @szczepiq What do you think?

Sounds great! We'll have more example projects, for different use cases (for example: minimal configuration, based on defaults VS full configuration; with notable releases VS without notable releases; with bintray VS with just maven central). So it would be good if the impl was generic enough to handle more 'test' projects in the future :D

mockitoguy commented 7 years ago

@mstachniuk, assigned to you, feel free to unassign if you choose to work on something else.

mockitoguy commented 7 years ago

I updated the description with a suggested solution.

mstachniuk commented 7 years ago

Current status: Check my changes on ms branch feel free to continue if you wish.

For now E2ETestingPlugin makes a few things:

For testing purposes you need to apply E2E plugin in *.gradle file and try run runTestReleaseMockito-release-tools-example task