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

Fail checks when output directory is not present #472

Merged
merged 2 commits into from Sep 6, 2014

Conversation

Projects
None yet
2 participants
@jugglinmike
Contributor

jugglinmike commented Sep 3, 2014

I recently ran across this behavior with a site I maintain: I wrote a TravisCI configuration file that ran nanoc check ilinks, but I forgot to ensure that Travis actually compiled the site first. For a few weeks, the tests have been passing, and we've been accumulating invalid internal links without knowing it.

@ddfreyne @bobthecow I'm sure you guys will have plenty to say about the code organization here. (For instance, do we really need a new Error subclass? If so, should it be defined elsewhere?) As always, I'm all ears :)

Commit message:

Currently, site checks pass when the output directory is not present.
Ensure that all checks fail in cases where there is no generated site
content to validate.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 3, 2014

Member

Looks good!

I like having a separate error class, because it makes it easier to handle different errors differently, or change the error message in a single place.

Member

ddfreyne commented Sep 3, 2014

Looks good!

I like having a separate error class, because it makes it easier to handle different errors differently, or change the error message in a single place.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 3, 2014

Member

The tests are likely failing due to Gemfile.lock not having 3.7.3 but rather 3.7.2 in it.

Member

ddfreyne commented Sep 3, 2014

The tests are likely failing due to Gemfile.lock not having 3.7.3 but rather 3.7.2 in it.

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 3, 2014

Member

If you rebase the branch against release-3.7.x, the tests should work properly on Travis.

Member

ddfreyne commented Sep 3, 2014

If you rebase the branch against release-3.7.x, the tests should work properly on Travis.

@jugglinmike

This comment has been minimized.

Show comment
Hide comment
@jugglinmike

jugglinmike Sep 3, 2014

Contributor

The tests are likely failing due to Gemfile.lock not having 3.7.3 but rather 3.7.2 in it.

Woa, nice detective work, there. I'm on it!

Contributor

jugglinmike commented Sep 3, 2014

The tests are likely failing due to Gemfile.lock not having 3.7.3 but rather 3.7.2 in it.

Woa, nice detective work, there. I'm on it!

Fail checks when output directory is not present
Currently, site checks pass when the output directory is not present.
Ensure that all checks fail in cases where there is no generated site
content to validate.
@jugglinmike

This comment has been minimized.

Show comment
Hide comment
@jugglinmike

jugglinmike Sep 3, 2014

Contributor

@ddfreyne I incorporated your feedback, and it almost passes the build. Now, instead of seeing build errors across the job matrix, all jobs pass except the jruby-1.7.11 / DISABLE_NOKOGIRI=1. Any ideas?

Contributor

jugglinmike commented Sep 3, 2014

@ddfreyne I incorporated your feedback, and it almost passes the build. Now, instead of seeing build errors across the job matrix, all jobs pass except the jruby-1.7.11 / DISABLE_NOKOGIRI=1. Any ideas?

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 4, 2014

Member

@jugglinmike The error you’re seeing is something I couldn’t quite debug properly. I am OK with leaving it as-is, because watch is deprecated in favour of guard-nanoc anyway.

Member

ddfreyne commented Sep 4, 2014

@jugglinmike The error you’re seeing is something I couldn’t quite debug properly. I am OK with leaving it as-is, because watch is deprecated in favour of guard-nanoc anyway.

@jugglinmike

This comment has been minimized.

Show comment
Hide comment
@jugglinmike

jugglinmike Sep 4, 2014

Contributor

@ddfreyne Alrighty. Is there something more I can do, then? Maybe disabling/removing the Nanoc::CLI::Commands::WatchTest#test_notify test?

Contributor

jugglinmike commented Sep 4, 2014

@ddfreyne Alrighty. Is there something more I can do, then? Maybe disabling/removing the Nanoc::CLI::Commands::WatchTest#test_notify test?

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 5, 2014

Member

@jugglinmike I’ll look into the test at some later time. I might just have to remove it. You can ignore it now though!

Member

ddfreyne commented Sep 5, 2014

@jugglinmike I’ll look into the test at some later time. I might just have to remove it. You can ignore it now though!

@jugglinmike

This comment has been minimized.

Show comment
Hide comment
@jugglinmike

jugglinmike Sep 5, 2014

Contributor

@ddfreyne I've pushed a commit to address your feedback. Not sure if/when you'd like to squash--say the word and I'll do it for ya

Contributor

jugglinmike commented Sep 5, 2014

@ddfreyne I've pushed a commit to address your feedback. Not sure if/when you'd like to squash--say the word and I'll do it for ya

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 6, 2014

Member

Nope, all fine. Thanks for the contribution!

Member

ddfreyne commented Sep 6, 2014

Nope, all fine. Thanks for the contribution!

ddfreyne added a commit that referenced this pull request Sep 6, 2014

Merge pull request #472 from jugglinmike/fail-check-for-empty-output
Fail checks when output directory is not present

@ddfreyne ddfreyne merged commit a442c7a into nanoc:release-3.7.x Sep 6, 2014

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details

@ddfreyne ddfreyne modified the milestone: 3.7.4 Sep 6, 2014

@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Sep 6, 2014

I ignored the failing tests and didn’t spot this typo: it should have been exist? rather than exist. My bad for not spotting this!

Fixed in d7a9b7e.

ddfreyne commented on lib/nanoc/extra/checking/check.rb in 10b4481 Sep 6, 2014

I ignored the failing tests and didn’t spot this typo: it should have been exist? rather than exist. My bad for not spotting this!

Fixed in d7a9b7e.

@jugglinmike jugglinmike deleted the jugglinmike:fail-check-for-empty-output branch Sep 6, 2014

@jugglinmike

This comment has been minimized.

Show comment
Hide comment
@jugglinmike

jugglinmike Sep 6, 2014

Contributor

My pleasure :)

Contributor

jugglinmike commented Sep 6, 2014

My pleasure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment