diff options
author | chirontt <chirontt@chirontt.org> | 2019-04-27 14:51:26 -0400 |
---|---|---|
committer | Florian Zschocke <florian.zschocke@devolo.de> | 2019-06-07 21:28:31 +0200 |
commit | c7bf84f79a03613368447ca87d86f033f0fedb7d (patch) | |
tree | 76816049216a38a0b03f2822eb75b82ac7704e64 /build.xml | |
parent | 694fd8896d2133fd5183349278be37e4f0c53d58 (diff) | |
download | gitblit-c7bf84f79a03613368447ca87d86f033f0fedb7d.tar.gz gitblit-c7bf84f79a03613368447ca87d86f033f0fedb7d.zip |
Zips of recreated hello-world.git and all external repositories for testing.
This hello-world.git repo is created using the native Git for Windows
software.
Various test classes in the GitBlitSuite test suite require the presence
of the hello-world.git repo in github.com/git/ which has been missing,
hence causing many test failures in the suite. This recreation of the
hello-world.git repo aims to conform to the many test cases'
requirements in the suite, and to be checked in as part of the gitblit
repo, thus eliminates the requirement of a remote hello-world.git repo
during the test run. The repo is now stored is a zip ball in the new
src/test/data folder.
The hello-world repo's various commit IDs were hard-coded in various
test classes. These commit IDs, which must now have new values in the
recreated repo, are now extracted out to the
src/test/data/hello-world.properties file. The gitblit's build.xml is
modified to generate the HelloworldKeys.java file containing the
hello-world.properties file's key strings, in similar fashion as the
existing generation of the com.gitblit.Keys.java file. And these key
strings in HelloworldKeys.java are now used in the various test classes,
thus eliminating the hard-coding of the hello-world repo's commit IDs in
the test code.
During the test run by GitBlitSuite test suite, some repos from GitHub
were cloned and became part of the test data. These repos are now zipped
to be part of gitblit repo itself, thus eliminating the network fetch at
the start of test run which can be slow, especially with the JGit repo
cloning which is huge and time consuming. The cloned JGit repo is now
zipped and checked in to gitblit, along with the other 4 repos
(hello-world, ambition, gitective and ticgit). They will be unzipped
during the test suite run and be available in the local file system,
thus avoiding the need for some network fetch.
Special note on the zipped JGit repo: this repo is big (and growing all
the time on GitHub), and takes up about 32MB of disk space after cloning
from GitHub. I've made it smaller by resetting HEAD back to a commit of
5 years ago (with git reset --hard <commitId> command), to put it back
to roughly where/when the tests were written for it (which is not quite,
because there are tons of commit history since which can't be removed.)
The local JGit repo is then garbage-collected (with git gc --prune
--aggressive) to reduce its size to about 19MB.
Zipped it is still 17MB. This is a lot of MBs for a few tests.
So the JGit repo is not included in this commit.
Fixes #1275
Diffstat (limited to 'build.xml')
-rw-r--r-- | build.xml | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -132,6 +132,11 @@ -->
<target name="test" depends="compile" description="compiles Gitblit from source and runs unit tests">
+ <!-- Generate the HelloworldKeys class from the hello-world.properties file -->
+ <mx:keys propertiesfile="${basedir}/src/test/data/hello-world.properties"
+ outputclass="com.gitblit.tests.HelloworldKeys"
+ todir="${basedir}/src/test/java" />
+
<!-- Compile unit tests -->
<mx:javac scope="test" />
|