This commit refactors travisBuild.sh to support building pushed branched on top
of PRs and tags.
This was prompted by enabling travis on a forked repository. The devlopment
flow then becomes:
- Fork google/go-jsonnet
- Enable travis on fork repository
- Push branch to forked repository
- Travis runs on the pushed branch
- Submit pull request once happy and tests pass in the forked repository
I tested 3 scenarii and they seem behave nicely:
- Running CI for pushed branch
- Running CI for tag
- Running CI for a Pull Request
As a side note, the previous error path didn't work as intented:
- The TRAVIS_PULL variable didn't exist
- We weren't exiting with a non 0 value in the else branch, so the build
succeeded instead of failing when travisBuild.sh didn't know what to do
with the pushed branch
Given the <tag> chosen in the GitHub releases page, this builds jsonnet
for darwin & linux amd64 (we can add more if needed), and uploads to
gs://jsonnet/<tag>/<os>/<arch>/jsonnet
People use these operators in tight loops, without even
thinking about it, and it's previous implementation required
multiple object lookups (std.), string comparisons (for types)
and multiple jsonnet function calls.
This change introduces builtin, efficient implementation.
It results in ~3x speedup in strContains benchmark that
Angus provided on Slack.
Additional benefit is that equals/primitiveEquals distinction
is now obsolete, which made things simpler for everyone.
* Add test support for multi-file output.
* Add -update support for multi-file output tests.
* Add support for string output in multi-file output mode.
* Rename 'stringOutput' to 'stringOutputMode' to better express what it does
* Refactor main_test to make it less nested.
This also causes the -update flag to output a list of files which
have been updated. This does not include the paths which are deleted
for multi-file tests.
Change the dump code so that it hides the values of variable
definitions if they're large. This means that godoc.org should
be able to deal with the output, and the godoc output is
readable without needing to read through a huge struct literal definition.
Other approaches might be to always generate an extra variable
(seems unnecessary) or to pass to writer explicitly to the dump
methods rather than swapping s.w out temporarily. The former
seems unnecessarily intrusive to the usual output; the latter
seemed unnecessarily intrusive to the source itself.
YMMV.
Instead of reading the files directly for --tla/ext-*-file, just add a
code snippet that does an import or importstr.
This makes relative imports work when the code-file path is not in the
current directory. It also makes the import lazy so if the arg/var is
not referenced, the file does not have to exist.
Fixes: google/jsonnet#452
There was a trivial bug, which disabled caching
of parsed, desugared and analyzed code. So imports
were only cached on data level, not on executable
ast level.
This change will likely result in ~10x speedup
for some users.
It seems like it was broken on older compilers
since pregenerated stdlib AST.
It adds go 1.8.x to travis, so that we have a chance
of catching when our "known to work" no longer holds.
A step towards a unified test suite. In particular this
lets us use C++ version with Go tests. The problem remains
that errors (both static and runtime) may differ between implementations.
This will require special handling. C++ version seems to pass all
"positive" tests. Go version also has this problem (error formatter used in tests is different).
Also native functions etc. are not handled in any way at the moment.