Skip to content

Improve tasks CLI #821

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

Merged
merged 26 commits into from
Aug 5, 2016
Merged

Improve tasks CLI #821

merged 26 commits into from
Aug 5, 2016

Conversation

etpinard
Copy link
Contributor

@etpinard etpinard commented Aug 4, 2016

resolves #794

In brief

this PR:

  • rewrote all the remaining shell script found in tasks/ in node which (1) will allow to Windows users to run them hassle-free (2) allow us to DRY up significant amounts of tasks code.
  • refactored the pretest lifecycle task. It now contains everything needed to prep up the CircleCI box before testing including booting up the imagetest docker container (which cleans up our circle.yml significantly)
  • hard-coded the mapbox access token used for testing into tasks/util/constants.js. No more export <mapbox-access-token> needed to start dev'ing!
  • the other commits DRYed up the existing tasks/ and devtools/ code.

Ideas for future development

  • Drop docker-compose for booting the imagetest container locally. That would mean one less dependency for devs 🎉 . Use npm run pretest instead (and maybe add an npm run postest task to shut down the container while at it).
  • Factor out all bundling code into a separate module (see Should we expose a high-level bundler module / CLI ? #768)

etpinard added 24 commits August 4, 2016 16:10
- to make it consistent with `npm run watch`
- no need to hide mapbox access tokens (there are public)
- remove `export MAPBOX_ACCESS_TOKEN` step in contributing guide
- group sub-tasks in subroutines
- DRY up using common module
- add image test container setup sub-task such that
  `npm run pretest` on CircleCI runs the docker container
  and sets it up once and for all
- format bundle does not make sense in a non-watchify
  context
- use in watchified bundle module
- use in image test container tasks to display
  to the last build/plotly.js bundle time.
- sudo ./tasks/run_in_testbed.sh mytestbed "export CIRCLECI=1 && node test/image/compare_pixels_test.js"
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js"
- npm run test-image
- npm run test-export
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the local vs CI differences are now handled at the task-runner script level.

updateVersion(constants.pathToPlotlyGeoAssetsSrc);
// copy topojson files from sane-topojson to dist/
function copyTopojsonFiles() {
fs.copy(constants.pathToTopojsonSrc, constants.pathToTopojsonDist,
Copy link
Contributor

Choose a reason for hiding this comment

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

🐄 separate lines for each arg?

@mdtusz
Copy link
Contributor

mdtusz commented Aug 5, 2016

Great PR!

After those little cows and things, 💃 !

@@ -15,6 +15,7 @@ containerCommands.ping = [
containerCommands.setup = [
containerCommands.cpIndex,
containerCommands.restart,
'sleep 1',
Copy link
Contributor Author

@etpinard etpinard Aug 5, 2016

Choose a reason for hiding this comment

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

Looks like the npm run pretest is a little more flaky than the previous list of shell commands on CIrcleCi.

Not sure what's up.

I've added sleep delays:

  • between the nw restart and the ping as well as as
  • between the docker run and setup commands.

Hopefully that will fix it. But we might have to look into this further.

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

Successfully merging this pull request may close these issues.

Rewrite shell scripts in tasks/ in node for windows users
2 participants