Changes

Jump to: navigation, search

Continuous Integration

3,663 bytes removed, 20:29, 26 January 2014
no edit summary
{{Admon/obsolete}}
 
<big><big> Continuous Integration Project for NexJ Express Code</big></big>
{{NexJ_Express Index}}
[[category: NexJ_Past_Projects]]
 
==Project goal==
Currently, NexJ has a Mercurial Repository (Internal) in which, the NexJ Express Server (Core) code is maintained with all its histories. NexJ is planning to share a Core Repository with the Open Source Community by creating a Repository (External) that will be kept in sync with the Internal Repository.<br/>
=== Contributors ===
* [[Minooz/Projects | Minoo Ziaei]]
* [[User:Gbatumbya|Grace Batumbya]]
==Project goal==
Currently, NexJ has a Mercurial Repository (Internal) in which, the NexJ Express Server (Core) code is maintained with all its histories. NexJ is planning to share a Core Repository with the Open Source Community by creating a Repository (External) that will be kept in sync with the Internal Repository.
==ChallengesCurrent Status==* <big><big>Project Completed</big></big><br/>  ==Project Phases===== Phase 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.Design Proposal (Done) ===: It's possible to use 'init' and create a new repo and just copy the files * Get requirements from repo A and add them.NexJ: This way the revision number will reset. And we will start repo B * Incorporate requirements from the tip NexJ into Design of the repo A.algorithm for syncing repositories: The problem appears if we want to clone just * Provide the tip of the repo A proposal for review and keep the same revision number approved - [[Continuous_Integration/proposal | final version of the 'tip'.: Here are some links that we went throughproposal]] , but no success yet. : [httphttps://mercurialdocs.selenicgoogle.com/wikidocument/EditingHistory Trimming History]:[http:d/17Fuj_9A7sBkzlbP0t0bOY3Qs1iiAhKAvfNTuUMnHUcg/www.selenic.com/mercurial/hgrc.5.html .hgrc fileedit?hl=en_US Google Doc ===Phase 2:[http://mercurial.selenic.com/wiki/TipsAndTricks mq strip changeset]Creating Similar Environment (Done) ===:[http://mercurial.selenic.com/wiki/EditingHistory Editing History!!]* Internal Repository*2- I was receiving an error message while trying to do * Creating a new build on Hudson. It didn't let Mercurial repository and adding some changes to clone the project on Hudson workspace. The error message is "Access is denied". So I had it to delete grow the project and create a new one. Apparently one history of the reasons is that Hudson doesn't let you queue the jobsit. So, if you interrupt a job that is scheduled, you'll get * Controller** This will be containing temporary repositories as the error messageresult of scripting.*3External Repository** Creating another Mercurial repository using 'hg' commands from the latest 'change- To run a bash script to build the project, there are 2 ways: :Execute Windows Batch Command: <source lang=bash>D:\cygwin\bin\bash /home/HudsonPrac/buildHudsonset' of Internal Repository.sh</source>:Invoke an Ant Script<source lang=java><project name="assign1" basedir="."> <target namePhase 3: Scripting (Done) ="myTarget" > <exec executable="D:\cygwin\bin\bash" newenvironment="false"> <arg value="/home/HudsonPrac/buildHudson.sh"/> </exec> </target></project></source>* Ant*3- Since the bash script is running in Windows platform through Cygwin, there are * Doesn't support some conflicts,so the PATH was changed to: PATH=/usr/bin:$PATHRead more about some conflicts [http://cygwin.com/cygwinof non-ug-net/using.html#using-pathnames here]*4- If there was an error applying a patch to a repository e.g. <code> hg import patch12.patch </code>, 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 regular Mercurial commands 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 itplay with ''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.sets''* Bash*5- If there is an uncommited message, the script can not work properly, e.g. Rev is 18+. So, error should be displayed * Supports everything we need for the uncommited change-setsproject.[[Continuous_Integration/script | script]]*6- To run JUnit Tests from command line:===Phase 4: add Running the JUnit installation directory and the junit.jar file and also QTjava to the CLASSPATH. e.g. <code>CLASSPATHscript on CI system (Done) ===".;D:\cygwin\home\java\junit3.0.1\junit.jar;C:\Program Files\java\jre6\lib\ext\QTjava"</code>: to run a sample AllTests class go * Buildbot* Hudson** Simple to the installation directory setup and run: <code> java junitconfigure.textui.TestRunner junit.samples.AllTests </code>** Runs different types of scripts: to run NexJ AllTests do:''bash'', ''ant'', ''batch'':: build the model: go ** Can be scheduled to ws/core/build/ run <code> ant </code> automatically or <code> ant -f build_JUnitTest.xml</code> manually** [http:: from command line: go to ws/out/core/ run <code> java junitiran.textuiproximity.TestRunner nexj.core.AllTests</code> (getting error IOExcpetion) so we just ran one test file <code> java junit.textui.TestRunner nexj.core.utilon.MathUtilTest</code> (We did some changes to <code> core/test/nexj/core/util</code> to practice with it) Or we can run the ant target for testca: <code> ant -f build_JUnitTest.xml test <8080/code>*7- Bugs after implementation at NexJTest Project]
===Phase 5: Working with remote repository; getting tip and log from remote repository is not as simple as moving to local repo and get all Code Review (Done)===* Execute the information we needscript on one of Nexj computers.
===Phase 6: NexJ Internal repo has several branches, and when cloning and pulling, we just needed to mention it Make Changes 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 per Code Review (GUIDDone).===: So, * Define paths based on Nexj's requirements* Modify the first big change was adding this command script to get the list of latest changesets up be able to the tip:::<code>hg log ${IntDir} retrieve change-r ${PrevRev}: -b default --template '{node}\n'</code>sets of a remote repository: This number will also be added to the commit summary while importing * Create specific error message for each problem during running the patch from Internal reposcript
==Resources=====Continuous Integration SystemPhase 7: Code Review (Done)===*'''Comparing Different CI Systems''' -> [http://confluence.public.thoughtworksSend code for review.org/display/CC/CI+Feature+Matrix CI Feature Matrix]#'''[[Hudson-nexj |Hudson]]'''#'''[[CruiseControl-nexj | Cruise Control]]'''#'''[[Buildbot-nexj | Buildbot]]'''#'''* [http://continuummercurial.apachenexj.org/ Apache Continuum]'''#'''Maven'''#'''[http:com//wwwexpress.anthillpro.com/html/productscgi/anthillos/default.html AnthillNexJ Express Repository in use]'''
===Version Control Tool=Challenges==* Basic Tutorial @ http://hginit.com/* '''comparing popular version control tools''' [http://martinfowler.com[Continuous_Integration/bliki/VersionControlTools.html]# '''[[Mercurial-nexj challenges | MercurialList of the challenges]]'''#'''CVS'''#'''SVN'''#'''Git'''
===Scripting=Resources==*1- '''[[Ant-nexj Continuous_Integration/Resources | AntList of Resources]]''':A new ant script is created e.g. ''buildHudson.xml'' that triggers the target(assign1.test) of main build file(build.xml) of the project. See below:<source lang=java><project name="assign1" basedir="." default="myTarget"> <target name="assign1.build.call"> <!-- Call the target that does everything --> <ant antfile="build.xml" target="assign1.test"/> </target> <target name="myTarget.check" depends="assign1.build.call"> <echo>The assign1.build was called!</echo> </target></project></source>*2- '''[[Bash-nexj| Bash]]'''

Navigation menu