Skip to content
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

How to test TerriaJS improvements #2

Open
rsignell-usgs opened this issue Mar 15, 2016 · 9 comments
Open

How to test TerriaJS improvements #2

rsignell-usgs opened this issue Mar 15, 2016 · 9 comments

Comments

@rsignell-usgs
Copy link
Member

For the TerriaJS-Dive project, I'm going to have to know how to test proposed fixes/enhancements.

I'm struggling a bit because my git skills are "advanced novice", and my nodejs skills are "dummy".

My deployment at:
http://comt.sura.org/proxy_3001/
is a local branch of the Australian national map at:
https://github.com/TerriaJS/map

Now I'd like to test this enhancement to display vectors by @Vort, described here:
TerriaJS/terriajs#1089 (comment)

I thought I could just test this by modifying my package.json file to point to these Vort branches thusly:

  "dependencies": {
    "compression": "^1.4.3",
    ...
    "terriajs": "git://github.com/Vort/terriajs#svg2",
    "terriajs-cesium": "git://github.com/Vort/cesium#svg2",
    ...
  },

and then doing

npm install ; gulp

But I got errors about a bunch of missing packages

@jiwalker-usgs , do you know the "correct" way to test these enhancements?

https://github.com/TerriaJS/terriajs/wiki/Deploying-and-building-TerriaJS

@Vort
Copy link

Vort commented Mar 15, 2016

I don't know how to do this in the proper way.
But unpacking, installing and linking .zip's from GitHub works fine.

@rsignell-usgs
Copy link
Member Author

@Vort, okay, yes, we can do that if we have to.

But I'm hoping that @jiwalker-usgs (or perhaps @kring or @stevage) will have a nicer solution.

@ChrisBarker-NOAA
Copy link

It sounds like what we really need is a "dummies guide" to setting up a development environment.

i.e a step by step process for getting all the code up and running, served from my own machine. And a what to do to update it all when I pull new code from gitHub or make a change.

And, of course, how to write and run tests.

Like Rich, I kinda-sorta know my way around git (and python, and python-based web services), but not deploying the html/css/javascript sandwich.

-CHB

@kring
Copy link
Member

kring commented Mar 15, 2016

I think the guides you're looking for are here:
https://github.com/NICTA/nationalmap/wiki/Deploying-a-copy-of-National-Map

And here:
https://github.com/TerriaJS/terriajs/wiki/Contributing-to-TerriaJS

Short version: you can use npm link to use a version of TerriaJS cloned from GitHub with your clone of NationalMap.

What you did with modifying package.json should work too, though. What errors did you get?

@kring
Copy link
Member

kring commented Mar 15, 2016

Oops, the second link above should be:
https://github.com/NICTA/nationalmap/wiki/Developers%27-Handbook

@Vort
Copy link

Vort commented Mar 16, 2016

@kring, setting git link in package.json leads to installation failure of terriajs and terriajs-cesium because of missing dev-dependencies. They gets installed only if you make a local copy of projects and run npm install there. I have tried to run npm install terriajs-cesium@Vort/cesium#svg2 --dev, but looks like it starts to install dev versions for all packages in a tree, which is not a good thing.

@kring
Copy link
Member

kring commented Mar 16, 2016

I'm not sure what you mean by "setting git link in package.json", since it's a command-line thing?

You do need to run npm install in the directory in which you've cloned TerriaJS. That will install dev dependencies, which is what you want.

In other words:

git clone [email protected]:Vort/terriajs.git vort-terriajs
git clone [email protected]:Vort/cesium.git vort-cesium
cd vort-cesium
git checkout f09da23
npm install
npm link
gulp terria-prepare-cesium
cd ..
cd vort-terriajs
git checkout 73f9655
npm link terriajs-cesium
npm install
gulp
npm link
cd ..
cd nationalmap
git link terriajs-cesium
git link terriajs
npm install
gulp

If you haven't already, you should probably create and use branches for your changes to TerriaJS and Cesium rather than using commit hashes in the checkout commands above.

@Vort
Copy link

Vort commented Mar 16, 2016

This works of course.
But is there a way to test changes without git clone, npm link etc.?
Just by adding this lines to package.json of https://github.com/TerriaJS/map:

    "terriajs": "git://github.com/Vort/terriajs#svg2",
    "terriajs-cesium": "git://github.com/Vort/cesium#svg2",

@kring
Copy link
Member

kring commented Mar 16, 2016

Yes, that should work too. I think you want:

"terriajs": "git://github.com/Vort/terriajs.git#svg2",
"terriajs-cesium": "git://github.com/Vort/cesium.git#svg2",

(although it might work without the .git, I'm not sure)

Also, depending on your version of npm, you may need to run npm twice because the first time will fail due to an npm bug. Details on that here: https://github.com/TerriaJS/terriajs/wiki/Problems-and-Solutions

Finally, we unfortunately don't keep https://github.com/TerriaJS/map as up-to-date as we should. It's possible that there are incompatibilities between that and the master version of TerriaJS. Cloning https://github.com/NICTA/nationalmap is more reliable until we get our act together a little better with the map repo.

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

No branches or pull requests

4 participants