Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Automate the retrieval of w3c tests. #199

Closed
wants to merge 3 commits into from
Closed

Automate the retrieval of w3c tests. #199

wants to merge 3 commits into from

Conversation

jdalton
Copy link
Contributor

@jdalton jdalton commented Jun 25, 2015

This PR automates the retrieval of w3c tests by an entry in the package.json

  "web-platform-tests": {
    "repo": "w3c/web-platform-tests#ba54984aa8838342ae97aed1fc7bd3cb5499f637",
    "path": "./tests/w3c"
  }

@arschmitz
Copy link
Contributor

👍 This keeps the repo a lot lighter / cleaner I like pulling in the tests

@jdalton
Copy link
Contributor Author

jdalton commented Jun 25, 2015

I'll fix those linting issues.

@arschmitz
Copy link
Contributor

@jdalton look like you need to sign the CLA too

@jdalton
Copy link
Contributor Author

jdalton commented Jun 25, 2015

Ok, signed the CLA.

I'm not sure why the other test fails are occurring, they pass when doing grunt test.

url = require('url');

var testPath = path.resolve(path.join(__dirname, '..', '..', pkg.path)),
token = 'Mjk5ZGQxNTk0ZDA3YTllY2I5YzlmMzRhZWYyOTEyZTQ1MDE2ZDdmNw==',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a big fan of relying on someone's personal token for this task to work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a no-scope public token (so harmless, readonly access). It allows getting the higher 50k per hour request limit.

@scottgonzalez
Copy link
Contributor

I still think this change isn't necessary, but I'll defer to the rest of the team.

@jdalton
Copy link
Contributor Author

jdalton commented Jun 29, 2015

@scottgonzalez

I still think this change isn't necessary, but I'll defer to the rest of the team.

What's nice about this approach is:

  • It's explicit about what version of the w3c tests PEP is testing against via the sha
  • It's easily customizable with configurable repo/sha/path from the package.json
  • It's quick with a one time, ~500k download at ~3 seconds, vs. a 60mb+ submodule/dev-dep
  • It doesn't require copy/pasting, manual modification, or tracking the w3c test source in the repo

"intern": "2.2.2"
"intern": "2.2.2",
"lodash": "^3.9.3",
"request": "^2.58.0"
Copy link

Choose a reason for hiding this comment

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

I know that this is opinionated but it looks like you have to download a half of the internet while getting request. Why not to use something more lighter for such a trivial task? How about got or asker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@narqo

but it looks like you have to download a half of the internet

That's a bit of a stretch. It dependencies aren't egregious and it only takes ~5 seconds to download.

Why not to use something more

Because I've used request and I trust it, it's the 4th (going on 3rd) most depended on package in npm, and it's a dev dep to boot (so not installed very frequently and only when deving).

scottgonzalez pushed a commit that referenced this pull request Jul 2, 2015
scottgonzalez pushed a commit that referenced this pull request Jul 2, 2015
@jdalton jdalton deleted the w3c branch July 2, 2015 16:34
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.

6 participants