Presentation is loading. Please wait.

Presentation is loading. Please wait.

1) CB plugin for Jenkins 2) Requirements Mapping

Similar presentations


Presentation on theme: "1) CB plugin for Jenkins 2) Requirements Mapping"— Presentation transcript:

1 1) CB plugin for Jenkins 2) Requirements Mapping
od od

2 1) CB plugin for Jenkins Two main CB Jenkins plugin parts:
“Status-check” on CB issues and other artifacts to trigger a Jenkins build (CB Trigger) “Publish” build results (stdout, stderr, status, build product, etc.) back to CB (CB Publisher) od

3 od

4 Features Superior to previously provided CB build features, it is more … Scalable .. distributed build topology Flexible .. more finer grained build trigger, publish to multiple server, adjust to custom tracker layout. Secure .. Jenkins build server runs as separate process (and on separate boxes) Extensible .. using other Jenkins plugins) od

5 Build Topologies JE CB JE CB CB JE JE CB Trigger Publisher CB od

6 Groovy Encapsulation, DSL, Closures,
Architecture Jenkins Build Trigger Post- build Publisher Logging Groovy Encapsulation, DSL, Closures, Pretended Properties CB Remote API CB od

7 Workflow y n CB CB Trigger script y n Build CB Publisher Jenkins
CRON pattern matches ? Scheduler y n CB CB Trigger script Trigger returns true y n Build CB Publisher od od

8 Job configuration (Trigger)
Configure Scheduler (CRON like) … to … call a trigger script at the configured period. Script must end with boolean expression! (CodeMirror supported syntax coloring) od

9 1) CB Trigger Scheduler always calls Trigger script, trigger script may or may not trigger build. Trigger should query a CB instance to decide what to do, e.g. check tracker status od

10 CB Trigger Log for each job
od

11 Trigger Log View Live view Scheduler triggered script execution
evaluation Trigger Script Expression evaluation triggers build (…or not) od

12 2) CB Publisher Always called after build if checked
Has implicit Build/Job/Jenkins Environment variable If publisher script fails, the build might fail too od

13 CB - Publisher Called after build Implicit variables: $build_?????
If the script above fails, what should be done? od

14 CB BuildLog Tracker $build_result $build_duration $build_output od

15 Jenkins Env variables for CB scripts
[listing pending] od

16 Thoughts If CB Publisher stays unchecked, the Trigger alone can be used to perform some regular maintenance. It does not have to return ‘true’ to trigger a build. The CB scripting library can be extended to create a Build tracker (maybe use the Jenkins job name for that) if such a tracker is not present in a project. There is no ‘logout’ being called from the Jenkins scripts. This is optional for a script. The Jenkins plugin will perform a logout on all open session for a job after the script finishes. There are still some class loading issues between Hessian’s Dynamic Proxy / Groovy and the Jenkins URLClassloader. Some more tests are needed here. It only CB affects classes handling custom fields. Plenty of simple, but flexible trigger examples can be provided. I will look into Janky and other CI servers that just emerged… od

17 od

18 2) ReqMapper Mapping Test/Test Results to functional Requirements in CB Post Test Automation Integrated into CB Jenkins plugin od

19 (CB hosted) Requirements
Source Unit tests Source matches functional requirements ? Testing Framework Test reports Testing (CB hosted) Requirements ReqMapper Jenkins od

20 ? Example CSTable t = DataIO.table(file, “Climate");
System.out.println(t.getName()); od

21 Run tests, test reports get created
Unit test @Req(id=1004) @Test public void testTableName() { // ... CSTable t = DataIO.table(r, “Climate"); Assert.assertEquals(“Climate”, t.getName()); } Run tests, test reports get created 2) Annotate Test with Req ID 3) ... <testcase classname="oms3.io.TableTest" name="testTableInfo" time="0.119"> <failure message="expected:<2> but was:<1>" type="junit.framework.AssertionFailedError"> junit.framework.AssertionFailedError: expected:<2> but was:<1> at oms3.io.TableTest.testTableInfo(TableTest.java:54) </failure> </testcase> <testcase classname="oms3.io.TableTest" name="testTableLayout" time="0.0020" /> <testcase classname="oms3.io.TableTest" name="testTableName" time="0.0010" /> <testcase classname="oms3.io.TableTest" name="testFirstTable" time="0.0030" /> testreport Test/Testreport driven change in REQ Status and content. 1) 4) Req Mapper od

22 REQMapper: Jenkins integration
See next slide od

23 REQ Mapper script For each test:
1. Fetch the CB REQ based on its Test ‘Req’ annotation 2. Transfer: req.<cbfields>  test.<testfields> od

24 Thoughts Example here shows Java/Junit. Other Unit testing frameworks can be implemented too. We’ve developed a language neutral annotation/parsing library. ReqMapper is bundled with the Jenkins plugin, now it should be easy to integrate REQ feedback into CI workflows. The Jenkins plugin development happens in Maven, hence the CB plugin is created as Maven project. All of the scripts can be executed external to Jenkins too. Extending the plugin to execute a script before saving might be useful (maybe next step) Codemirror javascript is used for syntax coloring and is bundled with the CB plugin. od


Download ppt "1) CB plugin for Jenkins 2) Requirements Mapping"

Similar presentations


Ads by Google