Commit Graph

32 Commits

Author SHA1 Message Date
Ben Liblit 6be7a1a8a2 Have Travis CI periodically try to build each subproject separately
If Gradle dependencies are set up correctly, then it should be
possible to build any subproject starting with a pristine tree.
These take too long to use for every commit, pull request, etc.  But
running an extensive test like this periodically (e.g., weekly) seems
reasonable.
2018-06-26 09:19:02 -07:00
Ben Liblit 8529c10491 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
2018-04-18 11:29:29 -05:00
Ben Liblit 00478ea806 Tell Travis CI to be even more patient during initial p2AsMaven downloads 2018-04-18 11:29:29 -05:00
Ben Liblit f28b63a025 Tell Travis CI to be more patient during initial p2AsMaven downloads 2018-04-18 11:29:29 -05:00
Ben Liblit ba01621de5 Don't use build cache (a.k.a. task output caching) under Travis CI
The performance improvement offered by the build cache is modest when
run by Travis CI.  This is probably because Travis CI does not keep
the cache on any local machine.  Instead, Travis CI uploads the build
cache across a network at the end of each run, then restores the cache
across the network at the start of the next run.  So in many cases
we're simply trading network access to original downloads for network
access to the cache image.

Furthermore, it's probably a better test to perform Travis CI testing
jobs from something closer to a clean slate.  We really want to know
whether everything builds and passes tests correctly starting from
nothing.  We don't want to risk accidentally thinking something would
work simply because we have a cached copy of what it did when it
worked previously.
2018-04-18 11:29:29 -05:00
Ben Liblit 01fc8fcae5 If tests fail, print full stack traces to aid debugging 2018-04-18 11:29:29 -05:00
Ben Liblit bd42510c6b Enable both parallel builds and build output caching by default
This should give us a nice build-performance boost, both locally and
in Travis CI.  I've used parallel builds routinely for months now, and
they're working fine.  Build output caching is newer, but it also
seems to be working well and saves us tremendous time on downloads.
2018-04-18 11:29:29 -05:00
Ben Liblit 9baf192416 If Travis CI gives us multiple CPUs, we may as well use them
I believe Travis CI jobs get two CPUs by default.

Doing parallel builds regularly is also a good way to help us discover
any build race conditions we may have.  There's no guarantee that any
such races will be revealed, but even exposing them
nondeterministically is better than having no possibility of exposing
them at all.
2018-04-18 11:29:28 -05:00
Ben Liblit 3cb91d1e67 Fix a shellcheck warning when setting a variable to the empty string 2018-04-18 11:29:28 -05:00
Ben Liblit baee9d32e1 Try to continue building/testing even after the first failure
If other, non-dependent tasks would also fail, I'd rather discover all
of them at once.
2018-04-18 11:29:28 -05:00
Ben Liblit d8948324f7 "rm" on macOS apparently doesn't understand long ("--foo") flags 2018-04-18 11:29:28 -05:00
Ben Liblit 393ef13622 macOS doesn't seem to have "xvfb-run", and may not need it anyway 2018-04-18 11:29:28 -05:00
Ben Liblit 5040019cec Turn on proper regression testing in Travis-CI
Many tests are excluded until
<https://github.com/liblit/WALA/issues/5> is fixed.  But we can at
least have Travis-CI watching over our shoulder to ensure that
no *new* regressions sneak into the tree.
2018-04-18 11:29:26 -05:00
Ben Liblit 3ba04469ad Teach Gradle how to download "/tmp/DroidBench" when needed
One less thing for developers to have to remember to do manually!
2018-04-18 11:29:26 -05:00
Ben Liblit 6007b11c3f Compile test code, but don't run it for now
The tests are currently broken due to some sort of problem using class
loaders to find supporting resources.  Until I figure this out, better
to have Travis-CI verify only the things we think work.
2018-04-18 11:29:25 -05:00
Ben Liblit ad60605fe8 In Travis-CI, test Maven and Gradle separately and concurrently
This should help identify cases where the Gradle build only works if
it runs before or after a Maven build.  It will also help us recognize
any Maven regressions accidentally introduced by our Gradle work.
2018-04-18 11:29:24 -05:00
Ben Liblit 99c2493e37 Revert "Build WALA using Gradle instead of Maven" (#298) 2018-04-18 12:15:56 -04:00
Ben Liblit 742cad58e9 Use Gradle to create selected Eclipse metadata before Maven builds
The Eclipse metadata files created in this way are not identical to
those that Buildship would create when importing into Eclipse.  The
tests in com.ibm.wala.cast.java.test.JDTJava15IRTests and
com.ibm.wala.cast.java.test.JDTJavaIRTests seem to pass using either
the Gradle-generated or the Buildship-generated versions.

As an aside, if you generate these files using Gradle first and *then*
import using Buildship, you end up with metadata that is identical to
what you would have had if you'd only imported with
Buildship.  (There's one irrelevant difference in an unimportant
"<comment>" element.)  So Maven's tests should run fine under any
wacky mix of Gradle- and Buildship-generated Eclipse metadata files.

That being said, I recommend not mixing build systems.  WALA can be
built using either Maven, Gradle, or Eclipse+Buildship, but you're
probably better off only using one of these in any given build tree.
A mixed tree *should* probably work, but I haven't tested it
thoroughly, and consider better to avoid doing.

Incidentally, if there are other Maven-preparation steps that we'd
like Gradle to automate for us, that can now be done easily by
creating more "prepareMavenBuild" Gradle tasks in other subprojects
and adding the appropriate dependencies.  For example, it would be
trivial to use this to automate downloading "/tmp/DroidBench",
installing the Android SDK, etc.
2018-04-17 15:02:36 -05:00
Ben Liblit 563d7446d1 Tell Travis CI to be even more patient during initial p2AsMaven downloads 2018-04-17 15:02:36 -05:00
Ben Liblit 0290469ba7 Tell Travis CI to be more patient during initial p2AsMaven downloads 2018-04-17 15:02:36 -05:00
Ben Liblit 6599d3d294 Don't use build cache (a.k.a. task output caching) under Travis CI
The performance improvement offered by the build cache is modest when
run by Travis CI.  This is probably because Travis CI does not keep
the cache on any local machine.  Instead, Travis CI uploads the build
cache across a network at the end of each run, then restores the cache
across the network at the start of the next run.  So in many cases
we're simply trading network access to original downloads for network
access to the cache image.

Furthermore, it's probably a better test to perform Travis CI testing
jobs from something closer to a clean slate.  We really want to know
whether everything builds and passes tests correctly starting from
nothing.  We don't want to risk accidentally thinking something would
work simply because we have a cached copy of what it did when it
worked previously.
2018-04-17 15:02:36 -05:00
Ben Liblit b13e5d72b1 If tests fail, print full stack traces to aid debugging 2018-04-17 15:02:36 -05:00
Ben Liblit 9cbfff23f5 Enable both parallel builds and build output caching by default
This should give us a nice build-performance boost, both locally and
in Travis CI.  I've used parallel builds routinely for months now, and
they're working fine.  Build output caching is newer, but it also
seems to be working well and saves us tremendous time on downloads.
2018-04-17 15:02:36 -05:00
Ben Liblit 17f42c3725 If Travis CI gives us multiple CPUs, we may as well use them
I believe Travis CI jobs get two CPUs by default.

Doing parallel builds regularly is also a good way to help us discover
any build race conditions we may have.  There's no guarantee that any
such races will be revealed, but even exposing them
nondeterministically is better than having no possibility of exposing
them at all.
2018-04-17 15:02:36 -05:00
Ben Liblit 96055cca75 Fix a shellcheck warning when setting a variable to the empty string 2018-04-17 15:02:36 -05:00
Ben Liblit c02776fc4d Try to continue building/testing even after the first failure
If other, non-dependent tasks would also fail, I'd rather discover all
of them at once.
2018-04-17 15:02:36 -05:00
Ben Liblit fb33cbe03b "rm" on macOS apparently doesn't understand long ("--foo") flags 2018-04-17 15:02:36 -05:00
Ben Liblit cb72ebc177 macOS doesn't seem to have "xvfb-run", and may not need it anyway 2018-04-17 15:02:36 -05:00
Ben Liblit bde936eec5 Turn on proper regression testing in Travis-CI
Many tests are excluded until
<https://github.com/liblit/WALA/issues/5> is fixed.  But we can at
least have Travis-CI watching over our shoulder to ensure that
no *new* regressions sneak into the tree.
2018-04-17 15:02:35 -05:00
Ben Liblit a32a3e3191 Teach Gradle how to download "/tmp/DroidBench" when needed
One less thing for developers to have to remember to do manually!
2018-04-17 15:02:35 -05:00
Ben Liblit 3f3de7a7fa Compile test code, but don't run it for now
The tests are currently broken due to some sort of problem using class
loaders to find supporting resources.  Until I figure this out, better
to have Travis-CI verify only the things we think work.
2018-04-17 15:02:35 -05:00
Ben Liblit 781a448a9a In Travis-CI, test Maven and Gradle separately and concurrently
This should help identify cases where the Gradle build only works if
it runs before or after a Maven build.  It will also help us recognize
any Maven regressions accidentally introduced by our Gradle work.
2018-04-17 15:02:35 -05:00