This adds some a basic integration tests for sample/js/{counter,fs}.
It work pretty much like this:
- Run `npm install`
- Do setup (good place to initialize the database) (optional).
- Start a http store from go.
- Run `node . <args...>`. The IntegrationTestSuite has convenience
methods to get the spec.
- Do teardown, which is a good time to check the output and the current state of the db (optional).
Towards #1888
* Revert "Revert "Share node_modules for samples/js" (#1967)"
This reverts commit 7bb1623e99.
* Add parent directory to the PATH
* Change run-all-js-tests to run samples/js before samples/js/**
* Fix a temporary comment
And fix new errors that were found.
This also adds tools/run-all-js-tests.py which runs `npm install`
and `npm test` in all directories containing a package.json file.
When the version in js/package.json is updated, publish a new version.
This does not yet do the actual publish. If this works it will be
updated in a later commit.
Issue #1200
This reverts commit af72024d35.
The computed version number is not good because `git log` does not
contain the full history so the number of rows is wrong.
This computes a new version based on the number of changes to the
js directory.
This does not yet actually publish the new version. I need to see how
Travis behaves before I can do that.
Towards #1200
As I was working on making deployment files get staged by Go/Python,
another pattern emerged. It seems like it will be not-uncommon to want
to stage all the files in the directory your script is in over to the
staging directory the system made for you. So, provide a helper to do
that.
Finding and running build scripts remains in Go
(tools/run_all_build.go and supporting libs), but the build scripts
themselves are in python now. This is because Go doesn't have much
support for copying files and directories around, which is kind of the
primary focus of build and packaging scripts.
Towards issue 677
The way I was forcing GOROOT wound up clearing the execution environment
of subprocesses when the caller intended to simply re-use the current
execution environment. This path correctly adds GOROOT in all cases.
Apparently, Travis runs a Go binary that was built with GOROOT=/usr/local/go,
but sets GOROOT to some other path in its execution environment. Tolerate this
by _always_ grabbing the current binary's GOROOT and setting it in the
execution environment used by subprocesses.
This patch introduces tools/run_all_build.go, a tool that looks for
files called build.go in our source tree and executes them using
'go run'. Currently, they're run in serial.
Also, some node projects are tweaked to make it clear that 'go run build.go'
is the supported mechanism for installing deps and building code.