Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Adding test task to gulpfile that will check all links #103

Merged
merged 8 commits into from
Nov 9, 2018

Conversation

etsauer
Copy link
Contributor

@etsauer etsauer commented Oct 23, 2018

What is this PR About?

Adding a test suite that we can use to check links and other quality validations.

How should we test or review this PR?

npm install
npm start

Then, in another window...

npm run test

TODOs:

  • Need to figure out how to incorporate server task into the test so that we don't need two windows
  • Add a test stage to pipeline
  • Create a Travis build to test Pull Requests
  • Fix broken links. ( Followup PR?)

Is there a relevant Trello card or Github issue open for this?

#18

Who would you like to review this?

cc: @redhat-cop/cant-contain-this


  • Have you followed the contributing guidelines?
  • Have you explained what your changes do, and why they add value to the uncontained.io guides?

Please note: we may close your PR without comment if you do not check the boxes above and provide ALL requested information.

@etsauer etsauer changed the title WIP: Adding test task to gulpfile that will check all links WIP Adding test task to gulpfile that will check all links Oct 23, 2018
@etsauer etsauer changed the title WIP Adding test task to gulpfile that will check all links Adding test task to gulpfile that will check all links Oct 23, 2018
Copy link
Contributor

@rdebeasi rdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome! The link checker works well, and it looks like a lot of broken links were fixed.

I added some comments on the code itself. FYI, it looks like the link checker considers 403 redirects to be broken links, even though they redirect to a valid page. For example, the Jenkins wiki appears to have moved, so our links to that wiki show up as errors.

It looks like there is at least 1 broken internal link remaining:

├─BROKEN─ http://localhost:26388/articles/app_dev/APM_guidance.html (HTTP_404)

The build fails if broken links are found, right? It's worth noting that if a site that we link to goes down, our build will fail until either the site is restored or we remove the link. I think that came up for us a while back.

What do you think about setting the build to continue even if this check fails, at least for now? That way, we could merge this PR and fix the remaining issues in a future PR.

},
junk: function(result)
{
// if (logOptions.excludeFilteredLinks === true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed?

process.on('uncaughtException', function (err) {
console.log(err);
});
var min = Math.ceil(10000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these values rounded? Is there some weird edge case where you were getting a decimal point?

link: function(result)
{
// Exclude cached links only if not broken
if (result.broken===false && result.http.cached===true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should links like this also be excluded?

  • ├─BROKEN─ http://router.default.svc.cluster.local:1936/healthz (ERRNO_ENOTFOUND)
  • ├─BROKEN─ https://console.c1-ocp.myorg.com:8443/healthz (ERRNO_ENOTFOUND)

@etsauer
Copy link
Contributor Author

etsauer commented Nov 7, 2018

@rdebeasi comments addressed.

@rdebeasi
Copy link
Contributor

rdebeasi commented Nov 9, 2018

In chat, we talked about possibly making build status and logs visible to the public. It sounds like that work would come later, though. For now, broken links will cause the builds to fail, and developers can see the link check result by running the build locally or asking someone with access to Jenkins.

These changes look good to me. Are you ready for them to be merged?

@etsauer
Copy link
Contributor Author

etsauer commented Nov 9, 2018

@rdebeasi book it. we'll clean up quickly as needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants