Nexj Express Continuous Integration Project
- 1- First challenge is how to trim history of a repository.
- We have a Mercurial repository called A. We want to clone repo A and create a new repo called B.
- It's possible to use 'init' and create a new repo and just copy the files from repo A and add them.
- This way the revision number will reset. And we will start repo B from the tip of the repo A.
- The problem appears if we want to clone just the tip of the repo A and keep the same revision number of the 'tip'.
- Here are some links that we went through, but no success yet.
- Trimming History
- .hgrc file
- mq strip changeset
- Editing History!!
- 2- I was receiving an error message while trying to do a new build on Hudson. It didn't let to clone the project on Hudson workspace. The error message is "Access is denied". So I had to delete the project and create a new one. Apparently one of the reasons is that Hudson doesn't let you queue the jobs. So, if you interrupt a job that is scheduled, you'll get the error message.
- 3- To run a bash script to build the project, there are 2 ways:
- Execute Windows Batch Command:
D:\cygwin\bin\bash /home/HudsonPrac/buildHudson.sh
- Invoke an Ant Script
<project name="assign1" basedir=".">
<target name="myTarget" >
<exec executable="D:\cygwin\bin\bash" newenvironment="false">
<arg value="/home/HudsonPrac/buildHudson.sh"/>
</exec>
</target>
</project>
- 3- Since the bash script is running in Windows platform through Cygwin, there are some conflicts,
so the PATH was changed to: PATH=/usr/bin:$PATH Read more about some conflicts here
- 4- If there was an error applying a patch to a repository e.g.
hg import patch12.patch
, there might be a problem with line numbers merging issue. So, there will be an error created with this message: "Hunk #1 Failed". There are some ways to remove the hunks manually or just ignore that patch, if the later versions are fixed.
- By "hunk" I mean a "snippet of change", i.e. a part of the "diff". TortoiseHg uses this terminology and so does darcs. – Deniz Dogan
- For Hunk Failed message, first we need to make sure it's not applied before. Second thing to check is that bases are the same. All the revisions before that new changeset even with failed build should be applied before applying the successfully built change-set.
- 5- If there is an uncommited message, the script can not work properly, e.g. Rev is 18+. So, error should be displayed for the uncommited change-sets.
- 6- To run JUnit Tests from command line:
- add the JUnit installation directory and the junit.jar file and also QTjava to the CLASSPATH. e.g.
CLASSPATH=".;D:\cygwin\home\java\junit3.0.1\junit.jar;C:\Program Files\java\jre6\lib\ext\QTjava"
- to run a sample AllTests class go to the installation directory and run:
java junit.textui.TestRunner junit.samples.AllTests
- to run NexJ AllTests do:
- build the model: go to ws/core/build/ run
ant
orant -f build_JUnitTest.xml
- from command line: go to ws/out/core/ run
java junit.textui.TestRunner nexj.core.AllTests
(getting error IOExcpetion) so we just ran one test filejava junit.textui.TestRunner nexj.core.util.MathUtilTest
(We did some changes tocore/test/nexj/core/util
to practice with it) Or we can run the ant target for test:ant -f build_JUnitTest.xml test
- build the model: go to ws/core/build/ run
- 7- Bugs after implementation at NexJ
- Working with remote repository; getting tip and log from remote repository is not as simple as moving to local repo and get all the information we need.
- NexJ Internal repo has several branches, and when cloning and pulling, we just needed to mention it as a default branch, to not to confuse revision numbers and latest changesets.
- Since the decimal part of the revision number will keep changing from computer to computer, it was preferred to use the global hex chagesetID (GUID).
- So, the first big change was adding this command to get the list of latest changesets up to the tip:
hg log ${IntDir} -r ${PrevRev}: -b default --template '{node}\n'
- This number will also be added to the commit summary while importing the patch from Internal repo