Lullabot / drupal9ci

Command Line Interface for implementing Continuous Integration in Drupal 9
GNU General Public License v3.0
161 stars 55 forks source link

suggestion: wrap codesniffer tests via Robo? #19

Closed dakkusingh closed 4 years ago

dakkusingh commented 6 years ago

For a personal project I am using Robo to execute all tests. This is partially how Acquia BLT also uses Robo as a wrapper for tasks.

The advantage is that you no longer have to configure each CI script should you want to make changes.

Here is an example of what I am proposing: https://github.com/dakkusingh/drupaltest/blob/master/RoboFile.php#L57

Happy to work on this and make a PR if you agree with this approach.

dakkusingh commented 6 years ago

Something like this :)

screen shot 2018-03-23 at 5 46 23 pm

juampynr commented 6 years ago

@dakkusingh yep! I have been working on this for the Travis CI implementation at d8cidemo (my pet project to test CI integrations). I plan to port those changes to this repository once I get the behat job passing.

juampynr commented 6 years ago

Ported to this repository.

The main reason why I used Robo in this way is because it allowed me to use Travis' test matrix and the after_script stage in a clean way. See https://github.com/Lullabot/drupal8ci/blob/master/dist/travisci/.travis.yml.

Next would be to port this approach to CircleCI's RoboFile.

dakkusingh commented 6 years ago

@juampynr great work. I had a look this morning :) On porting CircleCI and Travis, see my food for thought issue https://github.com/Lullabot/drupal8ci/issues/22

juampynr commented 6 years ago

This pull request moves all the circleci jobs logic to Robo tasks. Now that CircleCI and Travis CI use almost exactly the same RoboFile.php, I am considering moving to it's own repository.

deviantintegral commented 6 years ago

I would be really happy to have a common robofile between testing sites and testing individual modules.

Since robo has to run before composer, how do you propose bootstrapping the shared robo code?

dakkusingh commented 6 years ago

Hi @juampynr @deviantintegral a separate repo for Drupal Robo makes a lot of sense. Not only it can be used by drupal8ci & drupal_tests but also anyone requiring a common Robo Lib for their projects.

I had started something similar for my own projects, something similar here would be awesome here. https://github.com/dakkusingh/robo_drupal

deviantintegral commented 6 years ago

I just realized, as long as the CI tool is using a docker container, we can download and put any required RoboFile(s) inside of the container image itself. Is that what you were thinking?

dakkusingh commented 6 years ago

@deviantintegral I think..

For full projects (drupalci) its better to download and place the Robofile into the project as part of the setup script. That way, it can also be used for normal day-day operations such as githooks, manually running tests locally etc.

For module testing, (drupal_tests) we can download the Robofile on runtime in the container.

Only caveat is that if the user removes or modifies the Robo functions (in his project repo) and these functions are required by travis / CI - then all tests will start to fail. This wouldnt be a problem for module testing however.

What do you think?

guix77 commented 4 years ago

Hi, isn't it the case today?

juampynr commented 4 years ago

Correct. This was fixed. Closing.