dpc-sdp / dev-tools

Tools used for development of Tide distribution and modules.
2 stars 1 forks source link

Added conditional check for screenshot dir #24

Closed GROwen closed 5 years ago

GROwen commented 5 years ago

If a project's test profile doesn't define any tests ahoy test-behat will not create the screenshots directory and the .circleci/test-artifacts.sh script will cause the CI step "Copy artifacts" to fail

Changes

  1. Added a conditional check for the presence of the screenshots directory.
GROwen commented 5 years ago

@anthony-malkoun @AlexSkrypnyk this gets the job done but I'm not sure if there's a more graceful way of addressing this i.e. checking if there are any Behat Scenarios in the suite - which would be nice.

AlexSkrypnyk commented 5 years ago

@GROwen if you look at the CI config https://github.com/dpc-sdp/dev-tools/blob/master/.circleci/config.yml#L26 - that line expects that artifact directory to exists.

The best option is to create the screenshots directory how it is done here https://github.com/integratedexperts/drupal-dev/blob/8.x/.circleci/process-artifacts.sh

This approach also removes unnecessary logic (better readability) and makes sure that Circle CI UI always has that Artifacts tab, so that developers would not be confused why that tab disappears in some projects.

GROwen commented 5 years ago

Should you just create the directory in https://github.com/dpc-sdp/dev-tools/blob/master/.circleci/test-artifacts.sh?

That sounds too straight forward 😄

And now it's done - thanks @AlexSkrypnyk @anthony-malkoun, re-review please.