From 21b372134d83845304e09f49882cbd648d9468b3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 12 Oct 2022 10:39:40 +0100 Subject: [PATCH 1/9] Squashed 'autobuild/Common_scripts/' changes from 0326879..90d1a32 90d1a32 Identify template branches more precisely 5d6ed7c Merge remote-tracking branch 'origin/master' into production 8efc04a Merge commit '7efe8398003b4683618a5ebb653ebbfb01048085' into production 1b08979 Distinguish template (x) branches version numbers from master/main version numbers b8dc580 reverted Common_scripts/test/testethernetproduct.groovy to use CORE-98 branch of ftdi_relay 3adc8e8 Correct core importer script 9603e63 Deleted lines that were ostensibly commented out 096c865 Fixed the branch of ftdi_relay repo to be used 34e74f6 Merge branch 'production' of hydra:jenkinsautobuild/ahb_km_1024a_autobuild_scripts into production 25e279a Modified testethernetproduct.groovy to use the new web client based RegressionPower,py script 4cfa156 Merge commit 'a2a0c80228dd289fd4ba8ca3462bc7befb1e1366' 4f71bd7 CORE-745 - Handle a variantless product 2e60a3e Merge commit 'f418824c20f945588cda5108f1378d958a655df8' 67b33b4 Merge commit '59159f3d4a1d0566e6031d20d78099c9ffc2d344' 4bd6cda Use a jenkins root credential id to perform sudo operations 1a4ebc6 CORE-756 - Don't barf when something is already released 4316cc6 CORE-756 - Don't create a buildstamp tag on a release repo if one already exists df639bf CORE-756 - Stamp source code with a tag that includes the product variant - when there is one. This is to handle the case where 2 or more variants are being built from the same source code 9c89f2c CORE-745 - Unpack published zip file on server 3a372ac CORE-745 - Add publishing script 244c745 CORE-745 - Add publishing script 4bdd68f CORE-745 - Add publishing script 74ff084 CORE-745 - Add publishing script 91bccb0 CORE-745 - Add publishing script 0d48cdc CORE-745 - Password protect zip file 164c841 CORE-745 - Create file name with version number 9c8a175 CORE-745 - Create file name with version number c0c38d9 CORE-745 - Export zipped copy of JS client eaef1fd CORE-745 - Export zipped copy of JS client 7f6bee8 CORE-745 - Export zipped copy of JS client cc173da CORE-745 - Export zipped copy of JS client 83ea606 CORE-745 - Export zipped copy of JS client d5b7981 CORE-745 - Export zipped copy of JS client 6faf18d CORE-745 - Export zipped copy of JS client 07f9613 CORE-745 - Export zipped copy of JS client c674d50 CORE-745 - Export zipped copy of JS client f52a27b CORE-745 - Export zipped copy of JS client e86ccd1 CORE-745 - Export zipped copy of JS client cefdff2 CORE-745 - Export zipped copy of JS client 2c45634 CORE-745 - Export zipped copy of JS client db733c6 CORE-745 - Export zipped copy of JS client b202377 Merge commit '9c07e7aa2d889548575fedd5a69979c861e0d4f5' 620e793 Merge commit '4bfbe12020567b3790cbe3b1db458e34e0405316' 56eb4b8 Use Jenkins credential manager to login to FTP site 94cacf3 Use Jenkins credential manager to login to FTP site 785c74f DHBKM1024I-42: Build and run unit tests for KM-1024i ebbd441 Handle renamed release tags when importing release repos hierarchically 48b0c52 Mark all components below a released parent component as released - save time 3f654c2 Mark all components below a released parent component as released 2e950dd Mark all components below a released parent component as released fd5e5e7 Mark all components below a released parent component as released ce17357 Mark all components below a released parent component as released 15e4424 Mark all components below a released parent component as released 00cd7a7 Correct importing bf1b96f Correct importing fccc2e5 Correct importing d44427d Merge commit '42c4a8408235038e386695f7494d28c53c8d1dd1' into production 4a4b9ff Refresh tags each time the publish script is run 3fc89f4 Refresh tags each time the publish script is run ec6b507 Refresh tags each time the publish script is run 26a9c37 Output folder structure using tree f52ae87 Handle publish component selection for product variants a9237e7 Add some debugging to see why publishing is not working properly 8220990 Merge commit '577e5ca109c1a157578240089478f39c6487f618' as 'Common_scripts' add1a35 Remove broken subtree 9489dbd Squashed 'Common_scripts/' changes from 791c94c..98bc43b 98bc43b Use the autobuild script revision count to alter the version 659d0a0 Use the autobuild script revision count to alter the version 727be2d Use the autobuild script revision count to alter the version 554e551 Use the autobuild script revision count to alter the version a517c02 Use the autobuild script revision count to alter the version 268b7de Adopt the build stamp of the contained product 19d5feb Adopt the build stamp of the contained product 19a02a0 Merge commit 'ef15ab68681df6a42674955d4362dcb2444bb664' ef15ab6 Squashed 'Common_scripts/' changes from b70fe5f..791c94c 791c94c Pass meta to post action handlers; Pass release repo to post actions d21f4b1 Pass meta to post action handlers; Pass release repo to post actions 5e6c640 Merge remote-tracking branch 'origin/master' into production 7c05dde Use productvariant() instead of .productinfo.productname 8cd7ae9 Merge commit '0bb8e883772eb23ba839d6b934857b78fc1f5317' into production 2b61646 Products are those with WHOLE subcomponent 83257ea Merge commit 'a29f25f7be570e0c07a12f35055f8818cef47fa7' into production 062711c Merge commit 'ac6ed3de46417d119c9bd12ca1b1879976f99248' 2ae44ff Use productvariant() instead of .productinfo.productname 2e74b32 Provide a product variant translation table 806f098 Provide a product variant translation table 5db7c8d Provide a product variant translation table 3e317a5 Provide a product variant translation table 58d6990 Provide a product variant translation table ba8062d Provide a product variant translation table 14b1eff Provide a product variant translation table bf4a428 Debug sha/tags table e72f006 Debug sha/tags table 295c18c Debug sha/tags table 8aeb9a9 Debug sha/tags table ab4165e Debug sha/tags table 839f987 Debug sha/tags table cd0a353 Debug sha/tags table 94de9d2 Debug sha/tags table 60c1fba Debug sha/tags table 390c97c Debug sha/tags table da33b16 Debug sha/tags table 9235c1a Debug sha/tags table eb960a6 Debug sha/tags table 9f0a5db Debug sha/tags table 93b2f2b Debug sha/tags table e711a6c Debug sha/tags table 149aad2 Debug sha/tags table fd795d2 Debug sha/tags table 2580ed3 Debug sha/tags table 66a6672 Debug sha/tags table df5c9d1 Remove debug 82f9bb6 Use raw git to checkout each tag 1c9579f Use raw git to checkout each tag f55ca99 Merge commit '610e4be77e08d4b03b8157e38c099c43b2d6834e' into production 8d51dc7 Handle product variants; Change the title of the installer executable ab3516d Squashed 'Common_scripts/' changes from 0326879..b70fe5f 4ce8da8 Merge commit 'ab3516d23dbe1987e910de8ff63f6e8732bcc52d' into master b70fe5f Remove debug release filtering 3730461 Debug release filtering db92ee3 Debug release filtering 2393146 Use releasetag script 54bf29f Attempt to separate dependent products and sub-components 3c4de23 Debugging script d93f942 Debugging script caf71e3 Debugging script c993ecc Debugging script 2e5b6b2 Debugging script 0ad763c Debugging script d5a178b Debugging script 01d91a7 Debugging script d2a22db Debugging script 30ac58d Debugging script 490b37b Debugging script 2939eaf Debugging script 35d3862 Debugging script defc807 Debugging script f2e3e52 Debugging script b5e2894 Debugging script c2faf8a Debugging script fa199eb Debugging script d418e5a Debugging script f34fb2e Debugging script 04e947c Debugging script 48d7b0f Debugging script 38b562b Debugging script ac5e7cd Debugging script 1d3f184 Debugging script b187d23 Debugging script 1131865 Debugging script 68cbc00 Debugging script 5771490 Debugging ed17de0 Debugging b1bc540 Debugging e6c6fcf Debugging 57eeaf4 Comment out code to debug later a576d64 Script reorg 32a3aed Supply release tag processing 01ce780 Supply release tag processing af3e22d Supply release tag processing b7c5a66 Supply release tag processing 4fbe1d9 Supply release tag processing 44b1e13 Supply release tag processing af3c041 Supply release tag processing 8b361de Supply release tag processing 89736f0 Supply release tag processing 70d569c Supply release tag processing d2b8d1b Supply release tag processing ce33f59 Supply release tag processing 88cba3b Supply release tag processing 80bc64e Supply release tag processing 6488203 Supply release tag processing c2b27a8 Merge commit 'cd98f833a8db023604d045d9343f18f3a423da5c' 7682029 Merge commit 'e8e55db451e17f7b3edaab583e77a0428cebdfe7' into master 704e499 Start adding dependencies 940a8d5 Start adding dependencies 4a46b8f Build up a tag map 0ca7886 Build up a tag map 3dbdf85 Build up a tag map fb72031 Build up a tag map be599cb Build up a tag map 462b177 Build up a tag map 453a14a Build up a tag map c5f01d0 Build up a tag map 11826a4 Get list of tags for each product release repo 3981ece Filter long name releases from version selection cad2d4e Filter long name releases from version selection 8bd075f Filter long name releases from version selection 20c5648 Merge commit '6633e04d0257e6d52427b2ff761c8a5625196346' as 'Common_scripts' 9a31beb Remove folder 2767e8a Rename folder a5ee31d New files 2c6a90d New files e5d8c38 Merge commit 'c1344e90845db3aa76de5f3d0fc93abb462f8782' as 'Commons_scripts' c1344e9 Squashed 'Commons_scripts/' content from commit 0326879 9171d4d Initial commit e5bca0d Initial commit d1a56a9 Squashed 'Common_scripts/' changes from 2ab8282..0326879 b56e0df Merge commit 'd1a56a994c420a77f8bbf1909d510366a1578f8c' into master 1810f08 Merge commit '52965d83743e36da81c13d1b0e98e29244fbc095' 2f496a5 Merge commit '7707b2cffa0e4c308bb6453f5ef3b0eeffc3acf8' f082015 CORE-549 - Perform string substitions on ism file - to make the installer unique 433c860 CORE-549 - Perform string substitions on ism file - to make the installer unique 85f8e28 CORE-549 - Perform string substitions on ism file - to make the installer unique e4b734d CORE-549 - Perform string substitions on ism file - to make the installer unique 8e00a4b CORE-594 - Try to customise the Product Name property using the -z parameter 4ea46e3 Merge commit 'dea77dfa289efef365b5d1b48262c089832a5fa3' 6bcf0ea CORE-594 - Use an ini file to pass parameters to install shield c84a6cc Squashed 'Common_scripts/' changes from 951032d..2ab8282 c65e525 Merge commit 'c84a6cc5bee762502e189812fac8af7fcdf7fc9c' into master a0383e7 CORE-594 - Debug installer creation 1b3435c CORE-594 - Debug installer creation b6d72e7 CORE-594 - Debug installer creation 514fb12 Squashed 'Common_scripts/' changes from 6a415af..951032d cceac31 Merge commit '514fb12f1c2972f26cd37721ab231031f4ade4b4' 8d85bad CORE-594 - Debug installer creation 0852aed Squashed 'Common_scripts/' changes from 2c26b22..6a415af d652459 Merge commit '0852aed1da0acae2040eac5d584e46d1c7dbef90' 5772f19 CORE-594 - Debug installer creation 4ff3261 CORE-594 - Debug installer creation f94fcb8 CORE-594 - Debug installer creation ea79baa CORE-594 - Debug installer creation 458bfbd CORE-594 - Debug installer creation cf0c32b CORE-594 - Debug installer creation 32649d5 CORE-594 - Debug installer creation 53b39ce CORE-594 - Debug installer creation 4f193d3 CORE-594 - Debug installer creation 740b08c CORE-594 - Debug installer creation 5a13961 CORE-594 - Debug installer creation 7f19a14 CORE-594 - Debug installer creation 80a43cf CORE-594 - Debug installer creation 4b5f5db CORE-594 - Debug installer creation 1a52257 CORE-594 - Debug installer creation a278313 CORE-594 - Debug installer creation 504a41e CORE-594 - Debug installer creation 615c7d0 CORE-594 - Debug installer creation d121af7 CORE-594 - Debug installer creation 8ec1a77 CORE-594 - Debug installer creation fda3e88 CORE-594 - Debug installer creation 4e0c7b1 CORE-594 - Debug installer creation 2ceddfd CORE-594 - Debug installer creation a7ef1d3 CORE-594 - Debug installer creation 70e4f46 CORE-594 - Debug installer creation b77883f CORE-594 - Debug installer creation 217b7a1 CORE-594 - Debug installer creation 6f192be CORE-594 - Debug installer creation 3038e66 CORE-594 - Debug installer creation 7bb00e3 CORE-594 - Debug installer creation 6941dae CORE-594 - Debug installer creation 50d4956 CORE-594 - Debug installer creation 6f34d79 CORE-594 - Debug installer creation c7cb164 CORE-594 - Debug installer creation 6879ada CORE-594 - Debug installer creation 99024d4 CORE-594 - Debug installer creation 1b96d3c CORE-594 - Use an initial ISM file 43a36d7 CORE-594 - Start with the print server installer script f385118 CORE-594 - Correct artifact output folder a70bdad CORE-584 - Compile script c83236a CORE-584 - Compile script 4742e1c CORE-584 - Compile script fc1da1e CORE-584 - Compile script 48990a5 CORE-584 - Compile script e9e01a0 CORE-584 - Compile script 98690c5 CORE-584 - Compile script 10a4a80 CORE-594 - Create relese note script for LNPU c5c46e4 CORE-594 - Create compile script for LNPU b814fc4 CORE-594 - Create build script for LNPU bfd07dc CORE-594 - Scripts as a starting point from MCS 1b74ea8 Squashed 'Common_scripts/' content from commit 2c26b22 a838c2f Merge commit '1b74ea88ffc6cf2fa93834d9594acceb0787f4e5' as 'Common_scripts' 25c0406 Initial commit 85afca9 Create a script for publishing a set of debian packages to a remote update server e408bd1 Create a script for publishing a set of debian packages to a remote update server 6fd010a Create a script for publishing a set of debian packages to a remote update server 7515c39 Create a script for publishing a set of debian packages to a remote update server 0c5fb98 Create a script for publishing a set of debian packages to a remote update server 9ad83e9 Create a script for publishing a set of debian packages to a remote update server 80c2a61 Create a script for publishing a set of debian packages to a remote update server b0cc38c Create a script for publishing a set of debian packages to a remote update server 2c11a0c Create a script for publishing a set of debian packages to a remote update server 7e987f0 Create a script for publishing a set of debian packages to a remote update server f9c8438 Create a script for publishing a set of debian packages to a remote update server 46fc969 Create a script for publishing a set of debian packages to a remote update server b72ddc8 Create a script for publishing a set of debian packages to a remote update server 1beb23e Create a script for publishing a set of debian packages to a remote update server 97b31de Create a script for publishing a set of debian packages to a remote update server 9285f75 Create a script for publishing a set of debian packages to a remote update server d4513a8 Merge remote-tracking branch 'origin/production' b0d92b0 CORE-348 - Provide a script that can obtain a package from a release repo aa124fa CORE-348 - Provide a script that can obtain a package from a release repo 05f9c1b CORE-348 - Provide a script that can obtain a package from a release repo ddd07b9 CORE-348 - Provide a script that can obtain a package from a release repo ae97402 CORE-348 - Build a som-only dependent FDHV package git-subtree-dir: autobuild/Common_scripts git-subtree-split: 90d1a32e5ace1f8987c909ebd1ea3a23b8762f74 --- build/postactions.groovy | 30 +-- differences/dometahierarchy.groovy | 18 +- documentation/doxygen_deploy.groovy | 6 +- import/importer.groovy | 92 ++------- meta/folder.groovy | 118 +++++++---- packaging/jsclient.groovy | 180 +++++++++++++++++ product/info.groovy | 302 ++++++++++++++++++++++++++++ publish/do.groovy | 11 +- publish/jsclient.groovy | 89 ++++++++ publish/package.groovy | 36 +--- publish/packagecollection.groovy | 183 +++++++++++++++++ publish/promptingpublish.groovy | 35 ++-- publish/publishitems.groovy | 4 +- release/do.groovy | 65 +++--- release/tag.groovy | 39 ++++ remoteaccess/hostedftp.groovy | 15 +- somsoftware/sominfo.groovy | 31 +++ toolinstall/ubuntu.groovy | 37 ++++ versioncontrol/git.groovy | 32 +++ versionnumbering/generate.groovy | 26 ++- 20 files changed, 1111 insertions(+), 238 deletions(-) create mode 100644 packaging/jsclient.groovy create mode 100644 product/info.groovy create mode 100644 publish/jsclient.groovy create mode 100644 publish/packagecollection.groovy create mode 100644 release/tag.groovy create mode 100644 somsoftware/sominfo.groovy create mode 100644 toolinstall/ubuntu.groovy diff --git a/build/postactions.groovy b/build/postactions.groovy index 8b18908..3206004 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -85,16 +85,20 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam return jobname } -def deployjob(String buildselector, postbuildactions, String action, String alternativeparamname, String jobnameparametername, String jobselectorparametername) { +def deployjob(meta, String buildselector, postbuildactions, String action, String alternativeparamname, String jobnameparametername, String jobselectorparametername, String releaserepoparametername = '') { def jobname = getActionJobName(postbuildactions, action, alternativeparamname) if (jobname) { + def parameters = [ + new StringParameterValue(jobnameparametername, JOB_NAME), + new StringParameterValue(jobselectorparametername, buildselector), + ] + if (releaserepoparametername) { + parameters += new StringParameterValue(releaserepoparametername, meta.releaseinfo.releaserepoURL) + } build( wait: false, job: jobname, - parameters: [ - string(name: jobnameparametername, value: JOB_NAME), - string(name: jobselectorparametername, value: buildselector), - ] + parameters: parameters ) } } @@ -107,7 +111,7 @@ def readPostBuildInfo() { return postbuildinfo } -def performSuccessfulBuildActions() { +def performSuccessfulBuildActions(meta) { def postbuildactions if (params.POST_BUILD_INFO != null) { def postbuildinfo = readPostBuildInfo() @@ -119,12 +123,12 @@ def performSuccessfulBuildActions() { } } def String buildselector = "${BUILD_NUMBER}" - deployjob(buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR') - deployjob(buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB', 'BUILD_JOB_TO_ANALYSE', 'BUILD_JOB_TO_ANALYSE_SELECTOR' ) - deployjob(buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') - deployjob(buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') - deployjob(buildselector, postbuildactions, 'Update differences', 'DIFF_JOB', 'LATER_BUILD_JOB', 'LATER_BUILD_SELECTOR') - deployjob(buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB', 'BUILD_JOB', 'BUILD_JOB_SELECTOR') + deployjob(meta, buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR') + deployjob(meta, buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB', 'BUILD_JOB_TO_ANALYSE', 'BUILD_JOB_TO_ANALYSE_SELECTOR' ) + deployjob(meta, buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') + deployjob(meta, buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') + deployjob(meta, buildselector, postbuildactions, 'Update differences', 'DIFF_JOB', 'LATER_BUILD_JOB', 'LATER_BUILD_SELECTOR', 'TOP_LEVEL_META_REPOSITORY') + deployjob(meta, buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB', 'BUILD_JOB', 'BUILD_JOB_SELECTOR') } def sendemails(emailinfo) { @@ -201,7 +205,7 @@ def sendextemail(extmailinfo) { ) } -def performFailedBuildActions() { +def performFailedBuildActions(meta) { def postbuildactions = null if (params.POST_BUILD_INFO != null) { def postbuildinfo = readPostBuildInfo() diff --git a/differences/dometahierarchy.groovy b/differences/dometahierarchy.groovy index 3b25798..f9a2404 100644 --- a/differences/dometahierarchy.groovy +++ b/differences/dometahierarchy.groovy @@ -27,7 +27,7 @@ class JiraTicketInfo { } class DifferenceRecord { - String productname + String productvariant String subcomponentname String rawdifferencetext @@ -39,7 +39,7 @@ class DifferenceRecord { String comment DifferenceRecord() { - productname = "" + productvariant = "" subcomponentname = "" rawdifferencetext = "" @@ -56,7 +56,7 @@ class DifferenceRecord { for (j in jiraticketinfo) { jiraticketstring += j.dump() + " " } - return "Difference Record:\nproductname: ${productname}\nsubcomponentname: ${subcomponentname}\nrawdifferencetext: ${rawdifferencetext}\nsha: ${sha}\ntype: ${type}\nmergeinfo: ${mergeinfo}\njiraticketinfo: ${jiraticketstring}\ncomment: ${comment}" + return "Difference Record:\nproductvariant: ${productvariant}\nsubcomponentname: ${subcomponentname}\nrawdifferencetext: ${rawdifferencetext}\nsha: ${sha}\ntype: ${type}\nmergeinfo: ${mergeinfo}\njiraticketinfo: ${jiraticketstring}\ncomment: ${comment}" } } @@ -130,7 +130,7 @@ def boolean checkoutsourcerepo(buildmeta, String checkoutfolder) { } def String getcomponent(meta) { - def String uniquefolder = "${meta.productinfo.productname}_${meta.productinfo.subcomponentname}" + def String uniquefolder = "${meta.productvariant()}_${meta.productinfo.subcomponentname}" def String uniquefoldertemp = "${tempfolder}/${uniquefolder}" def String uniquefolderforsourcerepo = "${sourcerepofolder}/${uniquefolder}" @@ -343,7 +343,7 @@ def List fillrecord(meta, line, String sourcepath) { def List differencerecords = [] def DifferenceRecord dr = new DifferenceRecord() - dr.productname = meta.productinfo.productname + dr.productvariant = meta.productvariant() dr.subcomponentname = meta.productinfo.subcomponentname dr.rawdifferencetext = line @@ -755,7 +755,7 @@ def boolean report(meta, title, differencerecords, boolean iscomponent = true) { def title(earlymeta, latermeta) { return """ Differences in: - Product: ${earlymeta.productinfo.productname} Subcomponent: ${earlymeta.productinfo.subcomponentname} + Product: ${earlymeta.productvariant()} Subcomponent: ${earlymeta.productinfo.subcomponentname} between: then: Build date: ${earlymeta.jenkinsbuildinfo.builddate} Build stamp: ${earlymeta.buildstampinfo.buildstamp} Git revision: ${earlymeta.gitinfo.gitrevision} @@ -771,7 +771,7 @@ def compare(earlymetaitems, latermetaitems, key) { def earlymeta = earlymetaitems[key].metainfo def latermeta = latermetaitems[key].metainfo - summaryappend("${earlymeta.productinfo.productname} ${earlymeta.productinfo.subcomponentname}: Changed: ") + summaryappend("${earlymeta.productvariant()} ${earlymeta.productinfo.subcomponentname}: Changed: ") def boolean repoavailable def String uniquefolderforsourcerepo @@ -817,14 +817,14 @@ def comparehierarchy(meta, String earlymetafolder, String latermetafolder, Strin (result, componentdifferencerecords) = compare(earlymetaitems, latermetaitems, key) differencerecords = differencerecords + componentdifferencerecords } else { - summaryappend("${earlymeta.productinfo.productname} ${earlymeta.productinfo.subcomponentname}: ") + summaryappend("${earlymeta.productvariant()} ${earlymeta.productinfo.subcomponentname}: ") deletedcomponent(earlymetaitems, key) summaryappend("\n") } } for (key in latermetaitems.keySet()) { if (!earlymetaitems.containsKey(key)) { - summaryappend("${latermeta.productinfo.productname} ${latermeta.productinfo.subcomponentname}: ") + summaryappend("${latermeta.productvariant()} ${latermeta.productinfo.subcomponentname}: ") addedcomponent(latermetaitems, key) summaryappend("\n") } diff --git a/documentation/doxygen_deploy.groovy b/documentation/doxygen_deploy.groovy index 5054c02..e2f74a7 100644 --- a/documentation/doxygen_deploy.groovy +++ b/documentation/doxygen_deploy.groovy @@ -30,10 +30,10 @@ pipeline { importoptions.setfilter(ARTIFACT_PATH_TO_DOXYGEN_ROOT + '/**') doxygenmeta = importer.artifactimportfrombuildjob(meta, importoptions, DOXYGEN) - productname = doxygenmeta.productinfo.productname + productvariant = doxygenmeta.productvariant() buildstampprefix = doxygenmeta.buildstampinfo.buildstampprefix - echo "Doyxgen imported for product: ${productname} and build stamp prefix: ${buildstampprefix}" + echo "Doyxgen imported for product: ${productvariant} and build stamp prefix: ${buildstampprefix}" } } } @@ -41,7 +41,7 @@ pipeline { steps { script { doxygensource = "${DOXYGEN}/${ARTIFACT_PATH_TO_DOXYGEN_ROOT}" - pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productname}/${buildstampprefix}" + pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productvariant}/${buildstampprefix}" echo "Copying from ${doxygensource} to ${pathonserver}" if (isUnix()) { sh """#!/bin/bash diff --git a/import/importer.groovy b/import/importer.groovy index fa32ebf..439f788 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -3,7 +3,7 @@ versiongenerator = load("${autobuilder.commonscripts()}/versionnumbering/generat class ImportOptions { def m_script // Script to use if wanting to execute script commands (eg. echo -> script.echo) - + boolean m_incrementversionnumber // If true, increment the parent's (4th) version number with the (4th) version number of this object being imported String m_filter // Only import files/paths/folders that match the filter String m_excludes // Exclude files/paths/folders that match the exclude filter @@ -20,7 +20,7 @@ class ImportOptions { String m_repo String m_revision - + boolean m_showdetails ImportOptions(script, @@ -48,7 +48,7 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta m_showdetails = showdetails } - + String show() { return """m_incrementversionnumber: ${m_incrementversionnumber} m_filter: ${m_filter} @@ -66,7 +66,7 @@ class ImportOptions { m_revision: ${m_revision} """ } - + void setsourceselect(String sourceselect) { sourceselect = sourceselect.trim() switch (sourceselect) { @@ -105,7 +105,7 @@ class ImportOptions { void flattenimports(boolean flatten = true) { m_flatten = flatten } - + void includemetainfilter(boolean includemetainfilter = true) { m_includemetainfilter = includemetainfilter } @@ -233,11 +233,14 @@ def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String de } echo "Cloning associated repos inside path: ${destpath}" + int offset = 0 for(def collectedmeta in collectedmetalist) { def relatedmeta = collectedmeta.metainfo def relatedoffsetpath = collectedmeta.accumulatedpath def cloneurl = relatedmeta.releaseinfo.releaserepoURL - def clonerevision = "refs/tags/${relatedmeta.releasetag()}" + // The first entry in the list is the highest parent in the meta tree so use the tag provided in the import options + // This is because the revision that is recalled here could have been renamed since it was created during the release process + def clonerevision = (offset == 0) ? rootrevision : "refs/tags/${relatedmeta.releasetag()}" def clonepath = "${destpath}/${relatedoffsetpath}" if (relatedmeta.componentidentifier() != '_' && cloneurl != '') { @@ -250,12 +253,13 @@ def hierarchyartifactimportfromrepo(meta, ImportOptions importoptions, String de } else { echo "Not importing component that would be placed at path: ${clonepath}" } + offset += 1 } gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" echo "Marking root meta as released and rewriting meta file: ${metafilepath}" rewritemetafileasreleased(importedmeta, metafilepath) - + if (importoptions.m_incrementversionnumber) { meta.buildstampinfo.changerevision(versiongenerator.incrementrevision(meta.buildstampinfo.revision, importedmeta.buildstampinfo.revision)) } @@ -278,7 +282,7 @@ def artifactimportfromrepo(meta, ImportOptions importoptions, String destpath) { gh.gitCheckoutAlt(rooturl, rootrevision, destpath, "", 1, true, sparseitemlist) def importedmeta = meta.importrelated(importoptions.m_appendtoparentmeta, destpath, rooturl, rootrevision, gh.getGitInfo(destpath)) - + gh.stripgithistory(destpath) def metafilepath = "${destpath}/${meta.metafilepath()}" echo "Marking meta as released and rewriting meta file: ${metafilepath}" @@ -309,74 +313,6 @@ def artifactimport(meta, ImportOptions importoptions, String destpath) { return meta } -// Deprecated (use above) -def artifactimport(meta, - String sourceselect, - String jenkinsjob, - buildnumberorselector, - String repo, - String revision, - String destpath, - boolean incrementversionnumber = true, - String filter = '', - String excludes = '', - boolean fingerprint = false, - boolean nested = false) { - echo "DEPRECATED method: artifactimport(meta, String source, String jenkinsjob, buildnumberorselector, String repo, String revision, String destpath ...)" - def importoptions = importer.getNewImportOptions() - - importoptions.source(sourceselect, jenkinsjob, buildnumberorselector, repo, revision) - importoptions.setincrementversionnumber(incrementversionnumber) - importoptions.setfilter(filter) - importoptions.setexcludes(excludes) - importoptions.setfingerprint(fingerprint) - importoptions.setnested(nested) - - return artifactimport(meta, importoptions, destpath) -} - -// Deprecated (use above) -def artifactimport(meta, - String buildjob, - int buildnumber, - String destpath, - boolean incrementversionnumber = true, - String filter = '**', - String excludes = '', - boolean fingerprint = false) { - echo "DEPRECATED method: artifactimport(meta, String buildjob, int buildnumber, String destpath, ...)" - def importoptions = importer.getNewImportOptions() - - importoptions.jenkinsjob(buildjob, " ${buildnumber}") - importoptions.setincrementversionnumber(incrementversionnumber) - importoptions.setfilter(filter) - importoptions.setexcludes(excludes) - importoptions.setfingerprint(fingerprint) - - return artifactimport(meta, importoptions, destpath) -} - -// Deprecated (use above) -def artifactimport(meta, - String buildjob, - buildnumberorselector, - String destpath, - boolean incrementversionnumber = true, - String filter = '', - String excludes = '', - boolean fingerprint = false) { - echo "DEPRECATED method: artifactimport(meta, String buildjob, buildnumberorselector, String destpath, ...)" - def importoptions = importer.getNewImportOptions() - - importoptions.jenkinsjob(buildjob, buildnumberorselector) - importoptions.setincrementversionnumber(incrementversionnumber) - importoptions.setfilter(filter) - importoptions.setexcludes(excludes) - importoptions.setfingerprint(fingerprint) - - return artifactimport(meta, importoptions, destpath) -} - // Import the artifacts of a named child component found below parent meta's hierarchy def artifactimport(meta, parentmeta, @@ -393,12 +329,14 @@ def artifactimport(meta, def findresults = parentmeta.findAssociatedMeta(parentmetapath, childproduct, childsubcomponent) if (findresults.matchfound) { childmeta = findresults.matchedmetaitem.metainfo + echo "Parent meta indicates it is released: ${parentmeta.releaseinfo.released}" + echo "Child meta indicates it is released: ${childmeta.releaseinfo.released}" if (importoptions.m_sourceselect == 'Release repository' || childmeta.releaseinfo.released) { importoptions.releaserepo(childmeta.releaseinfo.releaserepoURL, childmeta.releasetag()) } else { importoptions.jenkinsjob(childmeta.jenkinsbuildinfo.buildjobname, childmeta.jenkinsbuildinfo.buildnumber) } - childmeta2 = importer.artifactimport(meta, importoptions, destinationfolder) + childmeta2 = artifactimport(meta, importoptions, destinationfolder) } else { error("Could not find meta associated with child: Product: ${childproduct} Sub-component: ${childsubcomponent}") } diff --git a/meta/folder.groovy b/meta/folder.groovy index 6715145..f025c44 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -4,13 +4,13 @@ import groovy.json.JsonSlurperClassic abstract class GISJsonSerialised implements Serializable { def script - + GISJsonSerialised(script) { this.script = script } abstract LinkedHashMap serialisationdata() - + abstract void deserialiseJson(rawmeta) def saveJsonSerialised(String outputfile, int prettylevel = 4) { @@ -127,7 +127,7 @@ class GitInfo extends GISJsonSerialised { this.remoteurl = another.remoteurl this.remoteinfo = another.remoteinfo } - + void set(String sourcepath, String sourcerevision, String gitrevision, String remoteurl, String remoteinfo) { this.sourcepath = sourcepath this.sourcerevision = sourcerevision @@ -170,14 +170,14 @@ class JenkinsBuildParameter extends GISJsonSerialised { private String name private String valuetype private String value - + JenkinsBuildParameter(script, String name = '', String valuetype = '', String value = '') { super(script) this.name = name this.valuetype = valuetype this.value = value } - + void set(String name, String valuetype, String value) { this.name = name this.valuetype = valuetype @@ -227,11 +227,11 @@ class JenkinsBuildInfo extends GISJsonSerialised { this.builddate = builddate this.isfullbuild = isfullbuild } - + void set(boolean isfullbuild) { this.isfullbuild = isfullbuild } - + boolean isFullBuild() { return isfullbuild } @@ -330,7 +330,7 @@ class BuildStampInfo extends GISJsonSerialised { def String buildstampcommasep = buildstamp.replace(".", ",") return buildstampcommasep } - + void changerevision(int newrevision) { script.echo("Build stamp currently ${buildstamp}") revision = newrevision @@ -357,7 +357,7 @@ class BuildStampInfo extends GISJsonSerialised { revision = rawmeta['revision'] buildstamp = rawmeta['buildstamp'] } - + LinkedHashMap serialisationdata() { def data = [ 'format' : format, @@ -460,7 +460,7 @@ class ConfigurationInfo extends GISJsonSerialised { class ChecksumPair extends GISJsonSerialised { private String filepath private String sum - + ChecksumPair(script, String filepath = '', String sum = '') { super(script) this.filepath = filepath @@ -485,14 +485,14 @@ class ChecksumSet extends GISJsonSerialised { private String format private String artifactpath private ArrayList checksumpairs - + ChecksumSet(script, artifactpath = '') { super(script) this.format = '0.1' this.artifactpath = artifactpath checksumpairs = new ArrayList() } - + ChecksumPair addChecksumPair(String filepath, String sum) { def cp = new ChecksumPair(script, filepath, sum) checksumpairs.add(cp) @@ -541,7 +541,7 @@ class ChecksumInfo extends GISJsonSerialised { checksumsets.add(cs) return cs } - + List checksumsetsserialised() { def associated = [] for (cs in checksumsets) { @@ -615,7 +615,7 @@ class MetaInfo extends GISJsonSerialised { private MetaInfo meta private String offsetpath private String uniqueid - + RelatedMetaInfo_v0_1(script, String offsetpath = '', MetaInfo meta = null, String uniqueid = UUID.randomUUID().toString()) { super(script, '0.1') this.offsetpath = offsetpath @@ -639,7 +639,7 @@ class MetaInfo extends GISJsonSerialised { ] return data } - + String getrelatedid() { return uniqueid } @@ -710,11 +710,13 @@ class MetaInfo extends GISJsonSerialised { associatedmeta = new ArrayList() } - void markreleased() { - script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") + void markreleased(boolean recursively = true) { + //script.echo("Marking product: ${productinfo.productname} component: ${productinfo.subcomponentname} as released") releaseinfo.markreleased() - for (associated in associatedmeta) { - associated.markreleased() + if (recursively) { + for (associated in associatedmeta) { + associated.markreleased() + } } } @@ -817,20 +819,20 @@ class MetaInfo extends GISJsonSerialised { String relativize(String mypath) { String pathRelative - script.echo("Seeing if ${mypath} begins with ${script.WORKSPACE}") + //script.echo("Seeing if ${mypath} begins with ${script.WORKSPACE}") if (mypath.startsWith(script.WORKSPACE)) { pathRelative = mypath.minus(script.WORKSPACE) - script.echo("Extracted ${pathRelative} from ${script.WORKSPACE} and ${mypath}") + //script.echo("Extracted ${pathRelative} from ${script.WORKSPACE} and ${mypath}") } else { pathRelative = mypath - script.echo("Path relative is unchanged: ${pathRelative}") + //script.echo("Path relative is unchanged: ${pathRelative}") } // Convert \ with / pathRelative = pathRelative.tokenize('\\').join('/') // Strip leading / if any pathRelative = pathRelative.replaceAll('^/+', '') - script.echo("Path relative is ${pathRelative}") + //script.echo("Path relative is ${pathRelative}") return pathRelative } @@ -845,7 +847,7 @@ class MetaInfo extends GISJsonSerialised { def String adjustedpath = relativize(destpath) def importedmetafile = adjustedpath + "/" + metafilepath() if (script.fileExists(importedmetafile)) { - script.echo("Deserialising meta at file: ${importedmetafile} (destpath: ${destpath})") + //script.echo("Deserialising meta at file: ${importedmetafile} (destpath: ${destpath})") mi.deserialiseJson(importedmetafile) RelatedMetaInfo rmi = new RelatedMetaInfo_v0_2(script, importedmetafile, adjustedpath, mi.productinfo.uniqueid) @@ -858,7 +860,7 @@ class MetaInfo extends GISJsonSerialised { } return mi } - + def copyrelatedmeta() { script.echo("Copying related input meta data to output meta") for (relatedmetainfo in associatedmeta) { @@ -914,14 +916,30 @@ class MetaInfo extends GISJsonSerialised { return productinfo.productname + "_" + productinfo.subcomponentname } + String productvariant() { + if (!productinfo.variant) { + return productinfo.productname + } else { + return productinfo.productname + "_" + productinfo.variant + } + } + String componentversionuniqueidentifier() { return componentidentifier() + "_" + buildstampinfo.buildstamp } - + String globalreleasetag() { return componentversionuniqueidentifier() + "_" + jenkinsbuildinfo.buildnumber } + String globalreleasevarianttag() { + if (!productinfo.variant) { + return globalreleasetag() + } else { + return globalreleasetag() + "_" + productinfo.variant + } + } + String releasetag() { return buildstampinfo.buildstamp + "_" + jenkinsbuildinfo.buildnumber } @@ -934,14 +952,14 @@ class MetaInfo extends GISJsonSerialised { private MetaInfo metainfo private String accumulatedpath private String accumulatedmetapath - + CollectedMeta(MetaInfo metainfo, String accumulatedpath = '', String accumulatedmetapath = '') { this.metainfo = metainfo this.accumulatedpath = accumulatedpath this.accumulatedmetapath = accumulatedmetapath } } - + class IterationInfo { private ArrayList metacollection private Map metamap @@ -951,7 +969,8 @@ class MetaInfo extends GISJsonSerialised { private String gatheredmetapath private boolean limiteddepth private int maxdepth - + private boolean markasreleased + IterationInfo(ArrayList metacollection, Map metamap, String comment = '', @@ -959,7 +978,8 @@ class MetaInfo extends GISJsonSerialised { String gatheredpath = '', String gatheredmetapath = '', boolean limiteddepth = false, - int maxdepth = 0) { + int maxdepth = 0, + boolean markasreleased = false) { this.metacollection = metacollection this.metamap = metamap this.comment = comment @@ -968,18 +988,19 @@ class MetaInfo extends GISJsonSerialised { this.gatheredmetapath = gatheredmetapath this.limiteddepth = limiteddepth this.maxdepth = maxdepth + this.markasreleased = markasreleased } - + String show() { - return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}" + return "Iteration:\nLevel: ${level}\nGathered path: ${gatheredpath}\nGathered meta path: ${gatheredmetapath}\nLimited depth: ${limiteddepth}\nMax depth: ${maxdepth}\nMark as released: ${markasreleased}" } - + void add(CollectedMeta item) { metacollection.add(item) metamap.put(item.metainfo.productinfo.uniqueid, item) } } - + def openchildmeta(IterationInfo ii, RelatedMetaInfo relatedmetainfo) { def MetaInfo mi = new MetaInfo(script) @@ -1000,6 +1021,10 @@ class MetaInfo extends GISJsonSerialised { imported = false } + if (ii.markasreleased) { + mi.markreleased(false) + } + def childmetainfo = [ 'imported': imported, 'nextgatheredpath': nextgatheredpath, @@ -1017,6 +1042,9 @@ class MetaInfo extends GISJsonSerialised { for (relatedmetainfo in associatedmeta) { if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + if (this.releaseinfo.released) { + othermeta.markreleased(false) + } def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, @@ -1026,7 +1054,8 @@ class MetaInfo extends GISJsonSerialised { nextgatheredpath, nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap @@ -1038,7 +1067,7 @@ class MetaInfo extends GISJsonSerialised { } return [ 'metacollection' : ii.metacollection, 'metamap' : ii.metamap, 'comment': ii.comment ] } - + def walkrelated(IterationInfo ii) { //script.echo("Walk related: ${ii.show()}") if (!ii.limiteddepth || ii.maxdepth > 0) { @@ -1056,7 +1085,8 @@ class MetaInfo extends GISJsonSerialised { childmetainfo.nextgatheredpath, childmetainfo.nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = childmetainfo.childmeta.walkrelated(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap @@ -1064,6 +1094,9 @@ class MetaInfo extends GISJsonSerialised { } } else if (!relatedmetainfo.format || relatedmetainfo.format == '0.1') { def MetaInfo othermeta = relatedmetainfo.meta + if (this.releaseinfo.released) { + othermeta.markreleased(false) + } def String nextgatheredpath = (ii.gatheredpath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredpath}/${relatedmetainfo.offsetpath}") def String nextgatheredmetapath = (ii.gatheredmetapath == '' ? relatedmetainfo.offsetpath : "${ii.gatheredmetapath}/${relatedmetainfo.offsetpath}") def nextii = new IterationInfo(ii.metacollection, @@ -1073,7 +1106,8 @@ class MetaInfo extends GISJsonSerialised { nextgatheredpath, nextgatheredmetapath, ii.limiteddepth, - ii.maxdepth - 1) + ii.maxdepth - 1, + this.releaseinfo.released) def results = othermeta.walkrelated_v0_1(nextii) ii.metacollection = results.metacollection ii.metamap = results.metamap @@ -1090,12 +1124,12 @@ class MetaInfo extends GISJsonSerialised { def Map metamap = new LinkedHashMap() return walkrelated(new IterationInfo(metacollection, metamap, '', 0, '', metapath)) } - + ArrayList releasewalker(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = new ArrayList() def Map metamap = new LinkedHashMap() def IterationInfo ii = new IterationInfo(metacollection, metamap, 'meta', 0, startpath, startmetapath, true, maxdepth) - script.echo("Release walker iteration info at start:\n${ii.show()}") + //script.echo("Release walker iteration info at start:\n${ii.show()}") def results = walkrelated(ii) return results.metacollection } @@ -1130,7 +1164,7 @@ class MetaInfo extends GISJsonSerialised { return versionuniquecollection } - + Map releasewalkerunique(int maxdepth, String startpath = '', String startmetapath = '') { def ArrayList metacollection = releasewalker(maxdepth, startpath, "${startmetapath}/${METAFOLDERNAME}") @@ -1142,7 +1176,7 @@ class MetaInfo extends GISJsonSerialised { return uniquecollection } - + MetaInfo getNewMetaObject(script) { return new MetaInfo(script) } diff --git a/packaging/jsclient.groovy b/packaging/jsclient.groovy new file mode 100644 index 0000000..916517c --- /dev/null +++ b/packaging/jsclient.groovy @@ -0,0 +1,180 @@ +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + if (env.RELEASE_REPO_VARIANT_SUFFIX) { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startbuild( + this, + PRODUCT_NAME, + SUBCOMPONENT_NAME, + RELEASE_REPO, + RELEASE_REPO_VARIANT_SUFFIX + ) + } else { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startbuild( + this, + PRODUCT_NAME, + SUBCOMPONENT_NAME, + RELEASE_REPO + ) + } + } + } + } + stage('Checkout dependencies') { + steps { + script { + configurationhelper = autobuilder.configurationhelper() + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + } + } + } + stage('Checkout source') { + steps { + script { + ESWDIR = 'esw' + SOURCEREVISION = SOURCE_REVISION.trim() + SOURCENAME = 'embedded software' + configurationhelper.gitCheckoutAndRegister(meta, SOURCENAME, SOURCE_REPO, SOURCEREVISION, ESWDIR, '', 0, false) + } + } + } + stage('Clean exports') { + steps { + script { + env.EXPORT = 'devjsclient' + cleanfolders = [ + EXPORT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Generating version info') { + steps { + script { + version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy") + version.generate(meta, SOURCE_REVISION, ESWDIR) + } + } + } + stage('Version stamp files') { + steps { + script { + convertdetails = [ + // File to convert Pattern to replace New string + ] + versionnumbering = load("${autobuilder.commonscripts()}/versionnumbering/do.groovy") + versionnumbering.stamp(convertdetails) + } + } + } + stage('Build package') { + steps { + script { + def absexportpath = "${WORKSPACE}/${EXPORT}" + plainzipname = 'export.zip' + if (env.RELEASE_REPO_VARIANT_SUFFIX) { + jsclientzipname = "${PRODUCT_NAME}_${RELEASE_REPO_VARIANT_SUFFIX}_${meta.buildstampinfo.buildstamp}_${plainzipname}" + } else { + jsclientzipname = "${PRODUCT_NAME}_${meta.buildstampinfo.buildstamp}_${plainzipname}" + } + dir(ESWDIR) { + if (isUnix()) { + sh """#!/bin/bash -v + mkdir "${absexportpath}" + if [ \$? -ne 0 ]; then exit 1; fi + zip -r "${absexportpath}/${plainzipname}" -P "${ZIP_PASSWORD}" devjsclient + if [ \$? -ne 0 ]; then exit 1; fi + zip -r "${absexportpath}/${jsclientzipname}" -P "${ZIP_PASSWORD}" devjsclient + if [ \$? -ne 0 ]; then exit 1; fi + """ + } + else { + bat """ + echo "Cannot be built on windows at the moment" + exit 1 + """ + } + } + dir(EXPORT) { + if (isUnix()) { + sh """#!/bin/bash -v + md5sum "${plainzipname}" > "${absexportpath}/${plainzipname}.md5" + if [ \$? -ne 0 ]; then exit 1; fi + sha256sum "${plainzipname}" > "${absexportpath}/${plainzipname}.sha256" + if [ \$? -ne 0 ]; then exit 1; fi + md5sum "${jsclientzipname}" > "${absexportpath}/${jsclientzipname}.md5" + if [ \$? -ne 0 ]; then exit 1; fi + sha256sum "${jsclientzipname}" > "${absexportpath}/${jsclientzipname}.sha256" + if [ \$? -ne 0 ]; then exit 1; fi + """ + } + else { + bat """ + echo "Cannot be built on windows at the moment" + exit 1 + """ + } + } + } + } + } + stage('Checksum artifacts') { + steps { + script { + def checksummable = [ + "${EXPORT}/${plainzipname}", + "${EXPORT}/${plainzipname}.zip.md5", + "${EXPORT}/${plainzipname}.zip.sha256", + "${EXPORT}/${jsclientzipname}", + "${EXPORT}/${jsclientzipname}.zip.md5", + "${EXPORT}/${jsclientzipname}.zip.sha256", + ] + checksumutils = load("${autobuilder.commonscripts()}/checksum/utils.groovy") + checksumutils.generatelist(meta, checksummable) + } + } + } + stage('Classifying publishable artifacts') { + steps { + script { + def publishable = [ + "${EXPORT}/**" + ] + publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy") + publishutils.generatelist(meta, publishable) + } + } + } + stage('Archiving artifacts') { + steps { + script { + def artifacts = [ + "${EXPORT}/**" + ] + def artifactlist = meta.generateartifacts(artifacts) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + artifactarchiver.archive(meta, artifactlist) + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} diff --git a/product/info.groovy b/product/info.groovy new file mode 100644 index 0000000..67d1449 --- /dev/null +++ b/product/info.groovy @@ -0,0 +1,302 @@ + +importer = load("${autobuilder.commonscripts()}/import/importer.groovy") +gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") +rt = load("${autobuilder.commonscripts()}/release/tag.groovy") + +class ProductDependency { + private script + private rtscript + private String productvariant + private String releaserepo + private String presplitreleasetag + private String releasetag + private String releasestate + + def ProductDependency(script, + rtscript, + String productvariant, + String presplitreleasetag, + String releaserepo) { + this.script = script + this.rtscript = rtscript + this.productvariant = productvariant + this.releaserepo = releaserepo + this.presplitreleasetag = presplitreleasetag + this.releasetag = '' + this.releasestate = '' + } + + def setreleasestate() { + def LinkedHashMap results = rtscript.startswithspecialprefix(presplitreleasetag) + if (results.hasspecialprefix) { + releasetag = results.tagwithoutprefix + releasestate = results.prefixfound + } else { + releasetag = results.tagwithoutprefix + releasestate = '' + } + } +} + +class ProductComponent { + private String componentname + private String releaserepo + private String releasetag + + def ProductComponent(String componentname, String releasetag, String releaserepo) { + this.componentname = componentname + this.releaserepo = releaserepo + this.releasetag = releasetag + } +} + +class ProductRelease { + private String sha + private String builddate + private ArrayList tags + private ArrayList productdependencies + private ArrayList productcomponents + + def ProductRelease(String sha, String builddate, ArrayList tags) { + this.sha = sha + this.builddate = builddate + this.tags = tags + this.productdependencies = new ArrayList() + this.productcomponents = new ArrayList() + } + + def addProductDependency(ProductDependency dependency) { + productdependencies.add(dependency) + } + + def addProductComponent(ProductComponent component) { + productcomponents.add(component) + } +} + +class ProductParsed { + enum State { + UNPARSED, + PARSED, + } + private State scanstate + private String productvariant + private ArrayList releases + + def ProductParsed(String productvariant) { + scanstate = State.UNPARSED + this.productvariant = productvariant + this.releases = new ArrayList() + } + + def markparsed() { + scanstate = State.PARSED + } + + def markparseerror() { + scanstate = State.PARSED + } + + def boolean parsed() { + return (scanstate == State.PARSED) + } + + def addProductRelease(ProductRelease productrelease) { + releases.add(productrelease) + } +} + +def String translateproductvariant(productvarianttranslation, + String releaserepo, + String productvariant) { + def translatedproductvariant = productvarianttranslation.get(releaserepo) + if (translatedproductvariant != null) { + echo "Translating product variant: ${productvariant} to: ${translatedproductvariant}" + return translatedproductvariant + } + return productvariant +} + +def ProductParsed addProductEntry(LinkedHashMap productcollection, + productvarianttranslation, + String productvariant, + String releaserepo) { + def ProductParsed productparsed + + if (productvariant && releaserepo) { + if (productcollection.get(releaserepo) == null) { // Use the first entry name only + echo "Adding product entry: releaserepo: ${releaserepo} (product variant: ${productvariant})" + def translatedproductvariant = translateproductvariant(productvarianttranslation, + releaserepo, + productvariant) + productparsed = new ProductParsed(translatedproductvariant) + productcollection.put(releaserepo, productparsed) + } else { + echo "Already added product entry: releaserepo: ${releaserepo} (product variant: ${productvariant})" + } + productparsed = productcollection.get(releaserepo) + } else { + echo "Not adding product entry: releaserepo: ${releaserepo} (product variant: ${productvariant})" + } + return productparsed +} + +def parseproductdependencies(LinkedHashMap productcollection, + productvarianttranslation, + productreleasemeta, + String productreleasefolder, + String containingproductvariant, + ProductRelease productrelease) { + def dependentmeta = productreleasemeta.getassociated(productreleasefolder) + + for (meta in dependentmeta) { + def translatedproductvariant = translateproductvariant(productvarianttranslation, + meta.releaseinfo.releaserepoURL, + meta.productvariant()) + if (translatedproductvariant && meta.productinfo.subcomponentname) { + def pd = new ProductDependency(this, + rt, + translatedproductvariant, + meta.releasetag(), + meta.releaseinfo.releaserepoURL) + pd.setreleasestate() + if (meta.productinfo.subcomponentname == 'WHOLE' && translatedproductvariant) { + if (translatedproductvariant != containingproductvariant) { // Don't add myself + addProductEntry(productcollection, + productvarianttranslation, + translatedproductvariant, + meta.releaseinfo.releaserepoURL) + productrelease.addProductDependency(pd) + } + } else { + def pc = new ProductComponent(meta.productinfo.subcomponentname, + meta.releasetag(), + meta.releaseinfo.releaserepoURL) + productrelease.addProductComponent(pc) + } + } else { + echo "Ignoring unnamed dependency in ${productreleasemeta.productvariant()}" + } + } +} + +def parseproductrepo(LinkedHashMap productcollection, + productvarianttranslation, + String productrepo, + String productreleasefolder) { + def boolean productrepogood = true + echo "Querying repo: ${productrepo}" + dir(productreleasefolder) { + deleteDir() + def returnstatus = sh(script: """#!/bin/bash + git init + if [ \$? -ne 0 ]; then exit 1; fi + git config remote.origin.url ${productrepo} + if [ \$? -ne 0 ]; then exit 1; fi + git config advice.detachedHead false + if [ \$? -ne 0 ]; then exit 1; fi + git sparse-checkout init + if [ \$? -ne 0 ]; then exit 1; fi + git sparse-checkout set meta/* + if [ \$? -ne 0 ]; then exit 1; fi + git pull -t + if [ \$? -ne 0 ]; then exit 1; fi + """, + returnStatus: true) + if (returnstatus > 0) { + dir('meta') { + deleteDir() + } + echo "Couldn't clone repository: ${productrepo} correctly" + productrepogood = false + } + } + if (productrepogood) { + def LinkedHashMap> shatagmap = gh.getremoteshatagmap(productrepo) + def String productvariant + def ProductParsed pp + shatagmap.each { sha, tags -> + //echo "Sha: ${sha} has tags: ${tags}" + dir(productreleasefolder) { + def returnstatus = sh(script: """#!/bin/bash + git checkout ${sha} + """, + returnStatus: true) + if (returnstatus > 0) { + dir('meta') { + deleteDir() + } + } + } + def productreleasemeta = meta.importrelated(false, productreleasefolder) + if (!productvariant) { + productvariant = productreleasemeta.productvariant() + pp = addProductEntry(productcollection, + productvarianttranslation, + productvariant, + productrepo) + if (pp) { + echo "Product variant created for: ${productrepo} name: ${pp.productvariant}" + } else { + echo "No product entry added/associated with ${productrepo} name: ${productvariant}" + } + } + + if (pp) { + def productrelease = new ProductRelease(sha, + productreleasemeta.jenkinsbuildinfo.builddate, + tags) + echo "Productrelease: ${productrelease.sha} created" + parseproductdependencies(productcollection, + productvarianttranslation, + productreleasemeta, + productreleasefolder, + pp.productvariant, + productrelease) + echo "Productrelease: ${productrelease.sha} added to Productvariant: ${pp.productvariant}" + pp.addProductRelease(productrelease) + } + } + if (pp) { + pp.markparsed() + echo "Productvariant: ${pp.productvariant} parsed" + } + } +} + +def iterateinitialproductrepos(initialproductcollection, + productvarianttranslation, + LinkedHashMap productcollection, + String productreleasefolder) { + for (productrepo in initialproductcollection.ProductReleaseRepos) { + parseproductrepo(productcollection, + productvarianttranslation, + productrepo, + productreleasefolder) + } + while( true ) { + boolean allparsed = true + echo "Parsing extra products" + productcollection.each { releaserepo, productparsed -> + if (!productparsed.parsed()) { + allparsed = false + parseproductrepo(productcollection, + productvarianttranslation, + releaserepo, + productreleasefolder) + } else { + echo "Parsed already ${productparsed.productvariant}" + } + } + if (allparsed) { + echo "All parsed" + break + } + } +} + +def LinkedHashMap getNewProductCollection() { + return new LinkedHashMap() +} + +return this \ No newline at end of file diff --git a/publish/do.groovy b/publish/do.groovy index ea090f0..bfc07af 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -22,7 +22,7 @@ def resetfolders() { } def productuniquefolder(releasemeta) { - return "${releasemeta.productinfo.productname}_${releasemeta.productinfo.subcomponentname}" + return "${releasemeta.productvariant()}_${releasemeta.productinfo.subcomponentname}" } def uniquereleasefolder(String productline, String softwarerelease, releasemeta) { @@ -90,7 +90,12 @@ def publish(hostedftpsiteinfo, String customer, String finalreleaserepofolder = def String ftproot = "${hostedftpsiteinfo.workingdirectory}${customer}" dir(finalreleaserepofolder) { + echo "Listing contents of what is going to be sent: (${finalreleaserepofolder})" + sh """#!/bin/bash + tree -a . + """ summaryappend("FTP operations: Transferring to ${ftproot}") + echo "Executing: ncftpput -u ${hostedftpsiteinfo.username} -p ******** -R ${hostedftpsiteinfo.url} \"${ftproot}\" ." sh """#!/bin/bash ncftpput -u ${hostedftpsiteinfo.username} -p ${hostedftpsiteinfo.password} -R ${hostedftpsiteinfo.url} "${ftproot}" . """ @@ -116,7 +121,7 @@ def recallcomponent(String productline, releaseinfo, String softwarerelease, ite def releasemeta = releaseinfo.metainfo def String uniquefolderforrepo = uniqueabsoluterreleasefolder(productline, releaserepofolder, softwarerelease, releasemeta) - summaryappend("${releasemeta.productinfo.productname} ${releasemeta.productinfo.subcomponentname}: ") + summaryappend("${releasemeta.productvariant()} ${releasemeta.productinfo.subcomponentname}: ") getcomponentartifacts(releaseinfo, uniquefolderforrepo, itempathstopublish) @@ -145,7 +150,7 @@ def publishhierarchy(hostedftpsiteinfo, releasemeta, String releasemetapath, Str resetfolders() preconditions() - def productline = releasemeta.productinfo.productname + def productline = releasemeta.productvariant() // Walk the meta information to a max depth, looking for artifacts to publish def componentReleaseInfoVersionUnique = releasemeta.releasewalkerversionunique(md, '', releasemetapath) diff --git a/publish/jsclient.groovy b/publish/jsclient.groovy new file mode 100644 index 0000000..accb78e --- /dev/null +++ b/publish/jsclient.groovy @@ -0,0 +1,89 @@ +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage('Clean imports') { + steps { + script { + env.JSCLIENT = "jsclient" + cleanfolders = [ + JSCLIENT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Import JS client artifacts') { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + def importoptions = importer.getNewImportOptions() + + importoptions.jenkinsjob(PACKAGE_CREATE_JOB, PACKAGE_CREATE_JOB_SELECTOR) + jsclientmeta = importer.artifactimportfrombuildjob(meta, importoptions, JSCLIENT) + + productname = jsclientmeta.productinfo.productname + productvariant = jsclientmeta.productvariant() + buildstampprefix = jsclientmeta.buildstampinfo.buildstampprefix + + echo "JS client imported for product: ${productvariant} and build stamp prefix: ${buildstampprefix}" + } + } + } + stage('Copy JS client to server') { + steps { + script { + jsclientsource = "${JSCLIENT}/${ARTIFACT_PATH_TO_JSCLIENT_ROOT}" + pathonserver = "${ROOT_PATH_ON_SERVER.trim()}/${productvariant}/${buildstampprefix}" + echo "Copying from ${jsclientsource} to ${pathonserver}" + if (isUnix()) { + sh """#!/bin/bash + rm -rfv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + mkdir -pv "${pathonserver}" + if [ \$? -ne 0 ]; then exit 1; fi + + echo mv -v "${jsclientsource}"/* "${pathonserver}" + mv -v "${jsclientsource}"/* "${pathonserver}"/ + if [ \$? -ne 0 ]; then exit 1; fi + """ + dir(pathonserver) { + sh """#!/bin/bash + mkdir -v unpacked + if [ \$? -ne 0 ]; then exit 1; fi + + unzip -P "${ZIP_PASSWORD}" export.zip -d unpacked + if [ \$? -ne 0 ]; then exit 1; fi + """ + } + } else { + error("This job does not run on Windows at the moment") + } + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} + diff --git a/publish/package.groovy b/publish/package.groovy index 68c41f3..04236e0 100644 --- a/publish/package.groovy +++ b/publish/package.groovy @@ -8,30 +8,6 @@ pipeline { } } } - stage('Checkout dependencies') { - steps { - script { - configurationhelper = autobuilder.configurationhelper() - - PYTHONURL = 'git@hydra:tools/python.git' - if (isUnix()) { - PYTHONBRANCH = "origin/3.6.3_linux" - } - else { - PYTHONBRANCH = "origin/3.6.3_windows" - } - PYTHONDIR = "${WORKSPACE}/python" - PYTHONROOTDIR = 'python' - configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR, PYTHONROOTDIR) - if (isUnix()) { - env.PYTHON = "${PYTHONDIR}/usr/local/bin/python3" - } - else { - env.PYTHON = "${PYTHONDIR}/ver/python.exe" - } - } - } - } stage('Clean exports') { steps { script { @@ -50,8 +26,16 @@ pipeline { importer = load("${autobuilder.commonscripts()}/import/importer.groovy") def packageimportoptions = importer.getNewImportOptions() - packageimportoptions.jenkinsjob(PACKAGE_CREATE_JOB, PACKAGE_CREATE_JOB_SELECTOR) - packageimportoptions.setincrementversionnumber(true) + // For backward compatibility - in case these parameters are not supplied + def packagelocation = params['PACKAGE_LOCATION'] ?: 'Jenkins job artifact' + def packagereleaserepo = params['PACKAGE_RELEASE_REPO'] ?: '' + def packagereleaserevision = params['PACKAGE_RELEASE_REVISION'] ?: '' + packageimportoptions.source(packagelocation, + PACKAGE_CREATE_JOB, + PACKAGE_CREATE_JOB_SELECTOR, + packagereleaserepo, + packagereleaserevision) + packageimportoptions.setincrementversionnumber(false) packagemeta = importer.artifactimport(meta, packageimportoptions, PACKAGEDEST) PACKAGE_FOLDER = "${PACKAGEDEST}/package" diff --git a/publish/packagecollection.groovy b/publish/packagecollection.groovy new file mode 100644 index 0000000..a87453e --- /dev/null +++ b/publish/packagecollection.groovy @@ -0,0 +1,183 @@ +def packagecollection = null + +/* Example expected JSON +{ +{ + "packages": [ + { + "Name": "gis-hmb-fd-hv-esw-el-sg1024", + "Location": "Jenkins job artifact", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_app_0.9.6_debpackage", + "Job selector": "1248", + "Release repo": "git@hydra:hmb_fd_hv-releases/sg1024/hmb_fd_hv_package.git", + "Release repo revision": "refs/tag/0.9.6.57669", + "Path": "package/gis-hmb-fd-hv-esw-el-sg1024_armhf.deb" + }, + { + "Name": "gis-hmb-fd-hv-control-service-sg1024", + "Location": "Jenkins job artifact", + "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_control_0.9.6_debpackage", + "Job selector": "1722", + "Release repo": "git@hydra:hmb_fd_hv-releases/sg1024/hmb_fd_hv_control_package.git", + "Release repo revision": "refs/tag/0.9.6.7964", + "Path": "package/gis-hmb-fd-hv-control-service-sg1024_armhf.deb" + } + ] +} +*/ + +def String asJsonText(somejson = packagecollection) { + return writeJSON(returnText: true, json: somejson, pretty: 1) +} + +def boolean packagecollection_exists() { + return (packagecollection != null) +} + +def packagecollection_set(String jsontext) { + packagecollection = readJSON(text: jsontext) + echo "Package collection info:\n${asJsonText(packagecollection)}\nType:\n${packagecollection.getClass()}" +} + +def packagecollection_get() { + return packagecollection +} + +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage('Clean exports') { + steps { + script { + PACKAGEDEST = "${WORKSPACE}/package" + cleanfolders = [ + PACKAGEDEST, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Transfer packages') { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + + packagecollection_set(PACKAGE_COLLECTION) + debpackagecollection = packagecollection_get() + + debpackagecollection.packages.each { debpackageinfo-> + echo "Processing package: ${debpackageinfo.Name}\n${debpackageinfo}\n${debpackageinfo.getClass()}" + echo "Info: ${debpackageinfo.Location}" + echo "Info: ${debpackageinfo['Location']}" + echo "Info: ${debpackageinfo['Job']}" + echo "Info: ${debpackageinfo['Job selector']}" + echo "Info: ${debpackageinfo['Release repo']}" + echo "Info: ${debpackageinfo['Release repo revision']}" + + def packagedest = "${PACKAGEDEST}/${debpackageinfo.Name}" + + def packageimportoptions = importer.getNewImportOptions() + // For backward compatibility - in case these parameters are not supplied + packageimportoptions.source(debpackageinfo['Location'], + debpackageinfo['Job'], + "${debpackageinfo['Job selector']}", + debpackageinfo['Release repo'], + debpackageinfo['Release repo revision']) + packageimportoptions.setincrementversionnumber(false) + packagemeta = importer.artifactimport(meta, packageimportoptions, packagedest) + + UNIQUE_PACKAGE_FOLDER = "${packagedest}/package" + + echo "Aptly config file is ${APTLY_CONFIG_FILE}" + echo "Repo name is ${REPO_NAME}" + echo "Unique package folder is ${UNIQUE_PACKAGE_FOLDER}" + + sh """#!/bin/bash -v + aptly config show + if [ \$? -ne 0 ]; then exit 1; fi + + aptly repo -config="${APTLY_CONFIG_FILE}" -with-packages show "${REPO_NAME}" + if [ \$? -ne 0 ]; then + echo "aptly repo ${REPO_NAME} does not exist; Creating it" + aptly repo -config="${APTLY_CONFIG_FILE}" create "${REPO_NAME}" + if [ \$? -ne 0 ]; then exit 1; fi + fi + aptly repo -config="${APTLY_CONFIG_FILE}" -with-packages show "${REPO_NAME}" + if [ \$? -ne 0 ]; then exit 1; fi + + # This errors if the published repo exists already; Ignore it + aptly publish -config="${APTLY_CONFIG_FILE}" drop "${DISTRIBUTION}" "${PUBLISH_PATH_PREFIX}" + aptly publish -config="${APTLY_CONFIG_FILE}" list + if [ \$? -ne 0 ]; then exit 1; fi + + aptly repo -config="${APTLY_CONFIG_FILE}" add "${REPO_NAME}" "${UNIQUE_PACKAGE_FOLDER}" + if [ \$? -ne 0 ]; then exit 1; fi + aptly repo -config="${APTLY_CONFIG_FILE}" show -with-packages "${REPO_NAME}" + if [ \$? -ne 0 ]; then exit 1; fi + """ + + echo "Snapshot name is ${SNAPSHOT_NAME}" + FULL_SNAPSHOT_NAME = "${REPO_NAME}_${SNAPSHOT_NAME}" + PACKAGE_VERSION_PREFIX = packagemeta.buildstampinfo.buildstampprefix + echo "Full Snapshot name is ${FULL_SNAPSHOT_NAME} containing packages of versions beginning with: ${PACKAGE_VERSION_PREFIX}" + // Convert prefix to regular expression + PACKAGE_VERSION_PREFIX_SPLIT = PACKAGE_VERSION_PREFIX.split("[.]") + PACKAGE_VERSION_REGEX = '' + i = 0 + while(true) { + if (i == PACKAGE_VERSION_PREFIX_SPLIT.size() - 1) { + PACKAGE_VERSION_REGEX += PACKAGE_VERSION_PREFIX_SPLIT[i] + break; + } + PACKAGE_VERSION_REGEX += PACKAGE_VERSION_PREFIX_SPLIT[i] + PACKAGE_VERSION_REGEX += '\\.' + i++ + } + sh """#!/bin/bash -v + # This errors if the snapshot exists already; Ignore it + aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "${FULL_SNAPSHOT_NAME}" + aptly snapshot -config="${APTLY_CONFIG_FILE}" drop "All_${FULL_SNAPSHOT_NAME}" + aptly snapshot -config="${APTLY_CONFIG_FILE}" create "All_${FULL_SNAPSHOT_NAME}" from repo "${REPO_NAME}" + if [ \$? -ne 0 ]; then exit 1; fi + + aptly snapshot filter -config="/home/repos/gis-aptly-config/gis.conf" "All_${FULL_SNAPSHOT_NAME}" "${FULL_SNAPSHOT_NAME}" 'Version (~ .*${PACKAGE_VERSION_REGEX}.*)' + if [ \$? -ne 0 ]; then exit 1; fi + aptly snapshot -config="${APTLY_CONFIG_FILE}" -with-packages show "${FULL_SNAPSHOT_NAME}" + if [ \$? -ne 0 ]; then exit 1; fi + + aptly publish -config="${APTLY_CONFIG_FILE}" -distribution="${DISTRIBUTION}" -component="${COMPONENT}" -gpg-key="${GPG_KEY_ID}" snapshot "${FULL_SNAPSHOT_NAME}" "${PUBLISH_PATH_PREFIX}" + if [ \$? -ne 0 ]; then exit 1; fi + aptly publish -config="${APTLY_CONFIG_FILE}" list + if [ \$? -ne 0 ]; then exit 1; fi + aptly publish -config="${APTLY_CONFIG_FILE}" show "${DISTRIBUTION}" "${PUBLISH_PATH_PREFIX}" + if [ \$? -ne 0 ]; then exit 1; fi + """ + } + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + } + } +} + diff --git a/publish/promptingpublish.groovy b/publish/promptingpublish.groovy index ce6a805..eff05e4 100644 --- a/publish/promptingpublish.groovy +++ b/publish/promptingpublish.groovy @@ -52,27 +52,30 @@ pipeline { stage('Identify software release to publish') { steps { script { + rt = load("${autobuilder.commonscripts()}/release/tag.groovy") gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") + gh.refreshtags(SOURCEDIR) def allreleases = gh.gettaglist(SOURCEDIR) def releases = new ArrayList() - if (FILTER_REDUNDANT_RELEASES == 'false') { - echo("Showing all releases") - releases = allreleases - } else { - echo("Showing filtered releases") - for (release in allreleases) { - if (!release.toLowerCase().startsWith("superceded") && - !release.toLowerCase().startsWith("superseded") && - !release.toLowerCase().startsWith("erroneous") && - !release.toLowerCase().startsWith("faulty") && - !release.toLowerCase().startsWith("ignore") && - !release.toLowerCase().startsWith("inmainline")) { - echo("Showing release: ${release}") - releases.add(release) - } else { - echo("Not showing release: ${release}") + for (release in allreleases) { + def boolean canadd = true + if (FILTER_REDUNDANT_RELEASES == 'true') { + def results = rt.startswithspecialprefix(release) + if (results.prefixfound) { + canadd = false } } + if (FILTER_LONGNAME_RELEASES == 'true') { + if (release.findAll(/[a-zA-Z]/)) { + canadd = false + } + } + if (canadd) { + echo("Showing release: ${release}") + releases.add(release) + } else { + echo("Not showing release: ${release}") + } } timeout(time: 10, unit: 'MINUTES') { release = input( diff --git a/publish/publishitems.groovy b/publish/publishitems.groovy index 9f6c368..cf04426 100644 --- a/publish/publishitems.groovy +++ b/publish/publishitems.groovy @@ -93,7 +93,7 @@ class PublishableItemsSelection { def meta = releaseinfo.metainfo for (publishableitem in meta.publishableinfo) { - menuitems.add("${meta.productinfo.productname} ${meta.productinfo.subcomponentname} ${publishableitem.filepath}") + menuitems.add("${meta.productvariant()} ${meta.productinfo.subcomponentname} ${publishableitem.filepath}") } } @@ -101,7 +101,7 @@ class PublishableItemsSelection { def meta = releaseinfo.metainfo for (publishableitem in meta.publishableinfo) { - menuitems.add("${meta.productinfo.productname}#${meta.productinfo.subcomponentname}#${publishableitem.filepath}") + menuitems.add("${meta.productvariant()}#${meta.productinfo.subcomponentname}#${publishableitem.filepath}") } } diff --git a/release/do.groovy b/release/do.groovy index 4dcb091..df0780a 100644 --- a/release/do.groovy +++ b/release/do.groovy @@ -133,7 +133,7 @@ def boolean getcomponentartifacts(toplevelbuildmeta, buildinfo, String repofolde echo "Exception occurred while copying artifacts from ${toplevelbuildmeta.jenkinsbuildinfo.buildjobname}: ${e.getMessage()}" result = false summaryappend("Does not exist:") - } + } if (result) { // Move relevant artifacts from temp folder to release position def originalrootdir = tempfolder + "/" + buildinfo.accumulatedpath @@ -180,19 +180,23 @@ def boolean checkforchange(buildmeta, previousreleasemeta) { def boolean changed = (shachanged | buildstampchanged) echo "changed: ${changed}" - + return changed } -def ArrayList maketaglist(buildmeta, String buildstamp, String otherreleasetags) { +def ArrayList maketaglist(buildmeta, boolean includebuildstamp, String buildstamp, String otherreleasetags) { def ArrayList taglist = new ArrayList() - taglist.add(buildstamp) - + if (includebuildstamp) { + taglist.add(buildstamp) + echo "Adding: ${buildstamp} to taglist" + } + def ArrayList othertaglist = otherreleasetags.split(',') for (othertagitem in othertaglist) { if (othertagitem?.trim()) { - def componentothertagitem = "${othertagitem.trim()}_${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}" + def componentothertagitem = "${othertagitem.trim()}_${buildmeta.productvariant()}_${buildmeta.productinfo.subcomponentname}" taglist.add(componentothertagitem) + echo "Adding: ${componentothertagitem} to taglist" } } return taglist @@ -231,7 +235,7 @@ def boolean releasegittag(String postcommitshacode, String tag) { def boolean releasegittags(String postcommitshacode, ArrayList taglist) { boolean tagadded = false - + summaryappend("Rel Tag ") for (tag in taglist) { if (releasegittag(postcommitshacode, tag)) { @@ -268,7 +272,7 @@ def boolean sourcegittag(String shacode, String tag) { def sourcegittags(String buildsha, List taglist) { boolean tagadded = false - + summaryappend(",Src Tag ") for (tag in taglist) { if (sourcegittag(buildsha, tag)) { @@ -311,7 +315,7 @@ def boolean isalreadyreleased(buildmeta, tag) { } else { String commitshacode = releasegitgetshacode(tag) if (commitshacode) { - echo "Tag: ${tag} already exists in this repo therefore marking as already released" + echo "Tag: ${tag} already exists in this repo therefore marking as already released" alreadyreleased = true } else { alreadyreleased = false @@ -325,46 +329,41 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source def String buildstamptag = buildmeta.releasetag() dir(releaserepo) { - def String precommitshacode = sh(script: "git rev-parse --verify HEAD", returnStdout: true).trim() - echo "Pre commit sha code: ${precommitshacode}" - def boolean alreadyreleased = isalreadyreleased(buildmeta, buildstamptag) - - def String postcommitshacode - def boolean changed = false if (alreadyreleased) { - summaryappend("Already-released,") - postcommitshacode = releasegitgetshacode(buildstamptag) - echo "Previous release sha code: ${postcommitshacode}" + summaryappend("Already-released.") + echo "Already released: Previous release sha code: ${releasegitgetshacode(buildstamptag)}" } else { + def boolean changed = false + def String precommitshacode = sh(script: "git rev-parse --verify HEAD", returnStdout: true).trim() + echo "Not released: Pre commit sha code: ${precommitshacode}" + releasegitadd() changed = checkforchange(buildmeta, previousreleasemeta) if (changed) { - releasegitcommit(buildstamptag) + releasegitcommit(buildstamptag) } else { releasegitreset() summaryappend("No-commit,") } - postcommitshacode = sh(script: "git rev-parse --verify HEAD", returnStdout: true).trim() + def String postcommitshacode = sh(script: "git rev-parse --verify HEAD", returnStdout: true).trim() echo "Post commit sha code: ${postcommitshacode}" - } - - ArrayList taglist = maketaglist(buildmeta, buildstamptag, otherreleasetags) - def tagadded = releasegittags(postcommitshacode, taglist) - - if (changed || tagadded) { - releasegitpush(dryrunpush) + def ArrayList taglist = maketaglist(buildmeta, true, buildstamptag, otherreleasetags) + def boolean tagadded = releasegittags(postcommitshacode, taglist) + if (changed || tagadded) { + releasegitpush(dryrunpush) + } } } dir(sourcerepo) { - def String srcbuildstamptag = buildmeta.globalreleasetag() + def String srcbuildstamptag = buildmeta.globalreleasevarianttag() def String buildsha = buildmeta.gitinfo.gitrevision if (buildsha) { - def ArrayList srctaglist = maketaglist(buildmeta, srcbuildstamptag, otherreleasetags) - def tagadded = sourcegittags(buildsha, srctaglist) + def ArrayList srctaglist = maketaglist(buildmeta, true, srcbuildstamptag, otherreleasetags) + def boolean tagadded = sourcegittags(buildsha, srctaglist) if (tagadded) { sourcegitpush(dryrunpush) } @@ -377,13 +376,13 @@ def gitrelease(buildmeta, previousreleasemeta, String releaserepo, String source def releasecomponent(toplevelbuildmeta, buildinfo, String otherreleasetags, String dryrunpush) { def buildmeta = buildinfo.metainfo def uriconverted = gh.uniquereporootname(buildmeta.gitinfo.remoteurl) - def String uniquefolder = "${buildmeta.productinfo.productname}_${buildmeta.productinfo.subcomponentname}_${uriconverted}" + def String uniquefolder = "${buildmeta.productvariant()}_${buildmeta.productinfo.subcomponentname}_${uriconverted}" def String uniquefolderforrepo = "${releaserepofolder}/${uniquefolder}" def String uniquefoldertemp = "${tempfolder}/${uniquefolder}" def String uniquefolderforsourcerepo = "${sourcerepofolder}/${uniquefolder}" - summaryappend("${buildmeta.productinfo.productname} ${buildmeta.productinfo.subcomponentname}: ") - repoandtagsappend("${buildmeta.productinfo.productname} ${buildmeta.productinfo.subcomponentname}: ") + summaryappend("${buildmeta.productvariant()} ${buildmeta.productinfo.subcomponentname}: ") + repoandtagsappend("${buildmeta.productvariant()} ${buildmeta.productinfo.subcomponentname}: ") def previousreleasemeta = checkoutreleaserepo(buildmeta, uniquefolderforrepo) checkoutsourcerepo(buildmeta, uniquefolderforsourcerepo) diff --git a/release/tag.groovy b/release/tag.groovy new file mode 100644 index 0000000..6155e7f --- /dev/null +++ b/release/tag.groovy @@ -0,0 +1,39 @@ + +def startswithspecialprefix(String releasetag) { + def RELEASETAG_PREFIXES = [ + 'superceded' : 'Misspelt - Indicates a later release has superseded the release with this prefix', + 'superseded' : 'Indicates a later release has superseded the release with this prefix', + 'erroneous' : 'The release was released unintentionally', + 'faulty' : 'The release was found to have a serious fault', + 'ignore' : 'The release should be ignored', + 'inmainline' : 'This release was associated with development branch which has now been merged into mainline', + ] + + def RELEASETAG_PREFIX_SEPERATOR = '_' + + def boolean hasspecialprefix = false + def String releasetagprefix = '' + def String prefixfound = '' + def String prefixmeaning = '' + def String tagwithoutprefix = releasetag + + for (def prefix in RELEASETAG_PREFIXES.keySet()) { + def meaning = RELEASETAG_PREFIXES.get(prefix) + if (releasetag.toLowerCase().startsWith(prefix)) { + prefixfound = prefix + hasspecialprefix = true + prefixmeaning = meaning + tagwithoutprefix = releasetag[(prefix.size() + 1)..-1] + break + } + } + + def results = [ 'hasspecialprefix' : hasspecialprefix, + 'prefixfound' : prefixfound, + 'tagwithoutprefix' : tagwithoutprefix, + 'meaning' : prefixmeaning, + ] + return results +} + +return this diff --git a/remoteaccess/hostedftp.groovy b/remoteaccess/hostedftp.groovy index cf62d32..e6187c8 100644 --- a/remoteaccess/hostedftp.groovy +++ b/remoteaccess/hostedftp.groovy @@ -1,11 +1,16 @@ ftpremote = load("${autobuilder.commonscripts()}/remoteaccess/ftp.groovy") def getHostedFTPSiteInfo() { - hostedftpsiteinfo = - ftpremote.createFTPSiteInfo("ftp.hostedftp.com", - "ftp@globalinkjetsystems.com", - "ramshorn42", - "/Customers/") + echo "Using ftp site credentials: ${HOSTEDFTP_CREDENTIALS_ID}" + withCredentials([usernamePassword(credentialsId: HOSTEDFTP_CREDENTIALS_ID, + usernameVariable: 'SUDO_USERNAME', + passwordVariable: 'SUDO_PASSWORD')]) { + hostedftpsiteinfo = + ftpremote.createFTPSiteInfo("ftp.hostedftp.com", + SUDO_USERNAME, + SUDO_PASSWORD, + "/Customers/") + } return hostedftpsiteinfo } diff --git a/somsoftware/sominfo.groovy b/somsoftware/sominfo.groovy new file mode 100644 index 0000000..a7fdc82 --- /dev/null +++ b/somsoftware/sominfo.groovy @@ -0,0 +1,31 @@ +def somsoftwareinfostore = null + +/* Example expected JSON +{ + "Artifact info": { + "Location": "Jenkins job artifact", + "Job": "SOM_GIS_master/SOM_GIS_master_build", + "Job selector": "true", + "Release repo": "git@hydra:som_gis-releases/som_gis_whole.git", + "Release repo revision": "" + } +}*/ + +def String asJsonText() { + return writeJSON(returnText: true, json: somsoftwareinfostore, pretty: 1) +} + +def boolean exists() { + return (somsoftwareinfostore != null) +} + +def set(String jsontext) { + somsoftwareinfostore = readJSON(text: jsontext) + echo "Som software support info:\n${asJsonText()}" +} + +def get() { + return somsoftwareinfostore +} + +return this \ No newline at end of file diff --git a/toolinstall/ubuntu.groovy b/toolinstall/ubuntu.groovy new file mode 100644 index 0000000..2720c62 --- /dev/null +++ b/toolinstall/ubuntu.groovy @@ -0,0 +1,37 @@ + +/* + * Install a list of packages though the usual apt-get system. + * This requires that the packages are available from the configured repos + */ +def installPackages(ArrayList packageNames, String root_credentials_id) { + echo "Using credentials: ${root_credentials_id}" + withCredentials([usernamePassword(credentialsId: root_credentials_id, + usernameVariable: 'SUDO_USERNAME', + passwordVariable: 'SUDO_PASSWORD')]) { + def sudo_S = "echo ${SUDO_PASSWORD} | sudo -S" + def sudo_Sk = "echo ${SUDO_PASSWORD} | sudo -S -k" + + sh """ + ${sudo_Sk} apt-get -y install ${packageNames.join(' ')} + """ + } +} + +/* + * Install all system packages needed by the ESW build + * for x86 (i.e. not cross-compilation) targets + */ +def installX86EswBuildDeps(String root_credentials_id) { + def packages = [ + "build-essential", + "lld" + ] + + // This should at least contain the x86 counterpart to the ARM compiler + def gccPackages = ["gcc-10", "g++-10"] + + def allPackages = packages + gccPackages + installPackages(allPackages, root_credentials_id) +} + +return this; diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index a22054b..bd389c3 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -25,6 +25,13 @@ String getGitInfo(String workingSetRootPath) { } } +def refreshtags(String workingSetRootPath) { + dir(workingSetRootPath) { + echo "${clh.getCommandOutput('git tag | xargs git tag -d')}" + echo "${clh.getCommandOutput('git fetch --tags')}" + } +} + ArrayList gettaglist(String workingSetRootPath) { ArrayList taglist = new ArrayList() dir(workingSetRootPath) { @@ -34,6 +41,31 @@ ArrayList gettaglist(String workingSetRootPath) { return taglist } +LinkedHashMap> getremoteshatagmap(String repositoryURL) { + def shatagliststring = clh.getCommandOutput("git ls-remote --tags --sort=-version:refname ${repositoryURL}") + def shataglist = shatagliststring.split('\\n') + + LinkedHashMap> shatagmap = new LinkedHashMap>() + for (shatag in shataglist) { + def shatagfields = shatag.split('\\t') + def sha = shatagfields[0].trim() + def tag = shatagfields[1].trim() + if (shatagmap.get(sha) == null) { + def ArrayList taglist = new ArrayList() + taglist.add(tag) + shatagmap.put(sha, taglist) + } else { + def taglist = shatagmap.get(sha) + taglist.add(tag) + shatagmap.put(sha, taglist) + } + } + shatagmap.each { sha, tags -> + echo "sha: ${sha} has tags: ${tags}" + } + return shatagmap +} + @NonCPS def ArrayList sparsecheckoutconfig(ArrayList paths) { ArrayList sparsecheckoutpaths = new ArrayList() diff --git a/versionnumbering/generate.groovy b/versionnumbering/generate.groovy index 5e974e2..2ae5262 100644 --- a/versionnumbering/generate.groovy +++ b/versionnumbering/generate.groovy @@ -1,5 +1,5 @@ gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") - + def int maxversionnumber() { def int MAXVERSIONNUMBER = 65535 return MAXVERSIONNUMBER @@ -11,7 +11,7 @@ int incrementrevision(int current, int increment) { return newrevision } -def getGitRevision(String gitrootpath, int basebuildnumber) { +def getGitRevision(String gitrootpath, int basebuildnumber = 0) { def int adjustedchangecount def String gitrevision def String remoteinfo @@ -21,7 +21,7 @@ def getGitRevision(String gitrootpath, int basebuildnumber) { if (isShallowCloned) { error("Cannot generate a version number from a shallow cloned repo at ${gitrootpath}") } - + dir( gitrootpath) { def int changecount = 0 if (isUnix()) { @@ -88,10 +88,11 @@ def getVersionPrefix(String sourcebranch, boolean droptrailingdot = false) { return thirdpartyversionprefix } + def xtypeversionprefix = "0.21000.0." for (split in splits2) { - if (split == "x") { - echo "Source branch name has '.x' or 'x.' in it. Defaulting to: ${mastertypeversionprefix}" - return mastertypeversionprefix + if (split.toLowerCase().startsWith("x")) { + echo "Source branch name has '.x' or 'x.' in it. Defaulting to: ${xtypeversionprefix}" + return xtypeversionprefix } } @@ -143,16 +144,23 @@ String generate(meta, String sourcerevision, String sourcepath, int basebuildnum def String gitrevision def String remoteinfo def String remoteurl - (gitrevisioncount, gitrevision, remoteinfo, remoteurl) = getGitRevision(sourcepath, basebuildnumber) + def int scriptgitrevisioncount + def String scriptgitrevision + def String scriptremoteinfo + def String scriptremoteurl + (scriptgitrevisioncount, scriptgitrevision, scriptremoteinfo, scriptremoteurl) = getGitRevision(autobuilder.getautobuildpath()) + + def int totalrevisioncount = incrementrevision(gitrevisioncount, scriptgitrevisioncount) + def versionprefix = getVersionPrefix(sourcerevision) - def buildstamp = versionprefix + gitrevisioncount.toString() + def buildstamp = versionprefix + totalrevisioncount.toString() echo "Build stamp is: ${buildstamp}" meta.gitinfo.set(sourcepath, sourcerevision, gitrevision, remoteurl, remoteinfo) - meta.buildstampinfo.set(versionprefix, gitrevisioncount, buildstamp) + meta.buildstampinfo.set(versionprefix, totalrevisioncount, buildstamp) return buildstamp } From a88d5c4c23c582ef4b89d3188eacbcf4a5e4968e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 12 Oct 2022 11:34:08 +0100 Subject: [PATCH 2/9] Squashed 'autobuild/Common_scripts/' changes from 90d1a32..53e70ad 53e70ad Merge commit '75958b53521e6f4b56109eb4639036cb37c183bc' ac3d208 reverted Common_scripts/test/testethernetproduct.groovy to use CORE-98 branch of ftdi_relay 1e3fc96 Added a web client, ftdi_relay_client.py, to control HMB power git-subtree-dir: autobuild/Common_scripts git-subtree-split: 53e70adf28d9ad96fc0f9c08623184483c450051 From fb139934cdc6b740f71cc9960d0cd34eabe3abed Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Wed, 12 Oct 2022 11:37:13 +0100 Subject: [PATCH 3/9] Correct merge --- autobuild/Common_scripts/meta/folder.groovy | 8 -------- 1 file changed, 8 deletions(-) diff --git a/autobuild/Common_scripts/meta/folder.groovy b/autobuild/Common_scripts/meta/folder.groovy index ed72959..f025c44 100644 --- a/autobuild/Common_scripts/meta/folder.groovy +++ b/autobuild/Common_scripts/meta/folder.groovy @@ -915,14 +915,6 @@ class MetaInfo extends GISJsonSerialised { String componentidentifier() { return productinfo.productname + "_" + productinfo.subcomponentname } - - String productvariant() { - if (!productinfo.variant) { - return productinfo.productname - } else { - return productinfo.productname + "_" + productinfo.variant - } - } String productvariant() { if (!productinfo.variant) { From e6087ac4b6926bdad8b578b5960b8785d07ae536 Mon Sep 17 00:00:00 2001 From: Dave Steele Date: Thu, 24 Nov 2022 11:26:24 +0000 Subject: [PATCH 4/9] Extend interface to allow for reverse --- verification/lib/tests/utils/fpm6Utils.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/verification/lib/tests/utils/fpm6Utils.h b/verification/lib/tests/utils/fpm6Utils.h index 3a8e1bb..cc184e8 100644 --- a/verification/lib/tests/utils/fpm6Utils.h +++ b/verification/lib/tests/utils/fpm6Utils.h @@ -39,10 +39,10 @@ protected: uint32_t seq[] = NULL, uint32_t seqLen = 0, uint32_t pgSel = 0, - CPulseGenerator3Auto* pPulseGenIn = 0) // If pPulseGenIn is valid, it overides any selection from pgSel. - // Used to add > 4 Pulse Generators, where required. + CPulseGenerator3Auto* pPulseGenIn = 0, // If pPulseGenIn is valid, it overides any selection from pgSel. + bool reverse = false) // Used to add > 4 Pulse Generators, where required. { - configPdEmulator (pCore, divRatio, encFreqKHz, clkFreqMHz); + configPdEmulator (pCore, divRatio, encFreqKHz, clkFreqMHz, reverse); fpmConfig (pCore, divRatio, numSubPixPhases, seq, seqLen, pgSel, pPulseGenIn); }; @@ -131,9 +131,16 @@ protected: // ------------------------------------ // Configure the product detect emulator // - void configPdEmulator(CCoreAuto* pCore, double divRatio, double encFreqKHz, double clkFreqMHz = 100.0) + void configPdEmulator(CCoreAuto* pCore, double divRatio, double encFreqKHz, double clkFreqMHz, bool reverse) { - pCore->pEncPdEmul1->pEncCtrl->SetSetAbsPos(1); + if (reverse) { + pCore->pEncPdEmul1->pEncCtrl->SetSetAbsPos(1); + pCore->pEncPdEmul1->pEncCtrl->SetEncDir(1); + } + else { + pCore->pEncPdEmul1->pEncCtrl->SetSetAbsPos(1); + pCore->pEncPdEmul1->pEncCtrl->SetEncDir(0); + } // Select source of pulses pCore->pFpmCtrl6->pSignalselection->SetFirePulseSel(1); From 9765aea0ec9e91db228f0758fd1f091b5e3a2a16 Mon Sep 17 00:00:00 2001 From: Dave Steele Date: Fri, 16 Dec 2022 14:51:44 +0000 Subject: [PATCH 5/9] Add ability to avoid startup delay on 1st to 2nd PD issue --- verification/lib/tests/utils/fpm6Utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verification/lib/tests/utils/fpm6Utils.h b/verification/lib/tests/utils/fpm6Utils.h index cc184e8..19d2c27 100644 --- a/verification/lib/tests/utils/fpm6Utils.h +++ b/verification/lib/tests/utils/fpm6Utils.h @@ -157,13 +157,13 @@ protected: // Generate a set of product detects // spaced at a given period // - void generatePDs(CCoreAuto* pCore, uint32_t numPDs, uint32_t periodNs) + void generatePDs(CCoreAuto* pCore, uint32_t numPDs, uint32_t periodNs, bool noStartupDelay = false) { for (int idx = 0; idx < numPDs; idx++) { issuePd(pCore->pEncPdEmul1); - if (idx == 0) + if ((idx == 0) && !noStartupDelay) { nsleepSim(periodNs - REG_WR_LATENCY_NS + STARTUP_LATENCY_NS); } From 616c8b13a0ac8724042d688529a9f472ac8c7c2d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 8 Jan 2023 14:01:08 +0000 Subject: [PATCH 6/9] Squashed 'autobuild/Common_scripts/' changes from 53e70ad..78da6d1 78da6d1 Debugging import 46e9d5d Debugging import fb8ce45 Debugging import 9b6ff58 Debugging import 5c2c0f7 Debugging import e81927d SPADP-28 - Stop publishing meta from vertical strip releases d4703b0 Add comment in importer 9b5176b Merge remote-tracking branch 'origin/master' into production c6a8475 Merge commit '113ac5ede52dd8a710e7069723502226703c0559' d7a0910 SPADP-24 - The jenkins job selector is not working (when it isn't a buildnumber) 78985d5 SPADP-24 - Correct condition deciding which version of Atlas Services to import 8c45cd5 Merge remote-tracking branch 'origin/master' into production 87effc8 SPADP-23 - Create dummy test job 30dffc5 Move the vertical stack build into a common area and in the core scripts 2712c88 Move the vertical stack build into a common area and in the core scripts 7e0601e Move the vertical stack build into a common area and in the core scripts 0127247 Move the vertical stack build into a common area and in the core scripts e158e75 Merge commit '8768e5358f446bde039daaf004f716aafd3ad195' 2655ab0 Merge commit '98a5cb568797c91c15632b3bf216553551f538aa' c151453 SPADP-23 - Create mock succeeding test 5737081 SPADP-23 - Create mock succeeding test 1cd7ac0 SPADP-23 - Create mock succeeding test 98a5cb5 Merge commit '6ee151044550dde7f0e3c9acf2f2abcad36b2aab' 5e94c36 SPADP-23 - Create mock succeeding test 94ced3c SPADP-23 - Create mock succeeding test f1503e0 CORE-840: Support more products e03d8d4 SPADP-23 - Create mock succeeding test 422b848 SPADP-23 - Create mock succeeding test 28260be SPADP-23 - Launch test runs; Collate results in a file system dfd8535 SPADP-23 - Launch test runs; Collate results in a file system 7b2246d SPADP-23 - Launch test runs; Collate results in a file system 3040663 SPADP-23 - Launch test runs; Collate results in a file system 315738c CORE-840: Add test utils script from MCS test repo. c557524 SPADP-23 - Launch test runs; Collate results in a file system 2bff028 SPADP-23 - Launch test runs; Collate results in a file system cfda694 SPADP-23 - Launch test runs; Collate results in a file system 34af202 SPADP-23 - Launch test runs; Collate results in a file system 747fe4a SPADP-23 - Launch test runs; Collate results in a file system 1ddeb99 CORE-840: Define the tool before using it........... 9540f0d SPADP-23 - Launch test runs; Collate results in a file system 88dd03e SPADP-23 - Launch test runs; Collate results in a file system 85ec9fe SPADP-23 - Launch test runs; Collate results in a file system 037f6fa SPADP-23 - Launch test runs; Collate results in a file system ca52ec2 CORE-840: Shuffle argument declaratio ns 704c1ad SPADP-23 - Launch test runs; Collate results in a file system 94315ce CORE-840: report what called the test aab7012 SPADP-23 - Launch test runs; Collate results in a file system b724bd2 CORE-840: implement config swapper because I'm running out of patience 1f48d9c SPADP-23 - Launch test runs; Collate results in a file system 08a3960 SPADP-23 - Launch test runs; Collate results in a file system a0c0c85 SPADP-23 - Launch test runs; Collate results in a file system e3cc87c CORE-840: shuffle stages 5edcb04 CORE-840: set job name d35d604 CORE-840: Swap D3000 label executor to ethernettest and follow through in reest of script fff5a68 CORE-840: Add launcher test job d6f5fc5 CORE-840: uppercase the file name. d82bdb1 CORE-840: env.node_name not label string f0910fd CORE-840: rewrite again f3faece CORE-840: Refactor updating test profile 132df74 CORE-840: fix groovy syntax bit 8324e6c CORE-840: remove redundant argument 459adf9 CORE-840: Print detected SM200 f69d681 CORE-840: Replumbing d1ec8a2 CORE-840: int not string 83fe392 Core-840: Try again 2c4ef7b CORE-840: .... 771893a CORE-840: abs pathing 1377f77 CORE-840: Pollforlife 43ba800 CORE-840: USe the correct variable name 8f816d9 CORE-840: Dive into python to poll from the correct node. d5831c9 CORE-840: Add Noted referring to what is executed where 8bbea8e CORE_840: revert node ce64f15 CORE-840: Do as node not agent c07d29e CORE-840: Revert and attempt IP Print. fc2187e CORE-840: Move agent declaration inline before step 9aff68e CORE-840: Avoid double dec 071229f CORE-840: try again 4571bfa CORE_840: Further Debugging executor. 82f02c2 CORE_840: running in debug 90b0455 CORE-840: Double declare agent. 98acf0d CORE-840: move the HMBUtils load position into the workspace on the slave. not the master. 1ea05f6 CORE-840: Refactor for control service state inspection. Rather Than jsoning the 8081 response. 6e4ed83 CORE-840: restore timeouts 9114845 CORE-840: Remove setting connection timeout 41c6784 CORE-840: Remove sleep in pollforlife method and rely on timeout 2a5695e CORE-840: check true ac773d8 CORE-840: Add hooks into setting up SM-200 as this is needed for DHCP. 4354353 CORE-840: post not get e44358d CORE-840: Query the object content "code" don't double key it. setConnectionTimeout also. 657dad4 CORE-840: Cleanup 26d24fc CORE-840: Catch more types of exception The connection is actually dead when we first make the get so not surprising. 1fd967c CORE-840: set timeout in milliseconds, not seconds. 5f01e0d CORE-840: throw now Raise aea3a63 CORE-840: Report correct method in timeout catch message. d11f50f CORE-840: Catch socket read timeout. 074c630 CORE-840: Declare Define responseObject higher 7f5fd84 CORE-840: Set http transaction timeout of 5. 3eb4ae6 CORE-840: lockable isn't a label? c58dbc9 CORE-840: lock the hardware resource, not the executor. 83c46d6 CORE-840: use the correct commenting syntax d4925ef CORE-840: Fix error in poll for life method syntax 90e347e CORE-840: Attempt to update the test machine profile before trying to run the tests. Add utils for reverse mapping test names. this is incomplete. 97f2052 CORE-840: Fix return object 414de18 CORE-840: fix syntax failure in http action debug 6ee1510 Merge commit '98700dd225bce064468be0938613409e09128c06' a2a7b61 CORE-840: Implement additional REST api controls in groovy for determining the state of HMB endpoint after a power cycle. d9a47fd SPADP-21: Don't treat unit test as post build action 43cdfb1 CORE-840: Refactoring POwer up down commands. 1705c12 CORE-840: I think this should have been find if called after the object is constructed. 6acb241 CORE-840: call the interpreter type from the class def. this might be wrong. 20711db CORE-840: report test env early on to work out structure efc8ce6 CORE-840: try different braces for string parsing 3306621 CORE-840: Correct port number 20ddcb8 CORE-840: def not var 56953bd CORE-840: stub history content as we want to move this anyway 88a9f6c CORE-840: import slurper before trying to create one 3f52006 CORE-840: Correct string braces, was JS 2a30ba7 CORE-840: Open brace. Used VSCode static analysis to clean imported script. 2206eed CIRE-840: Groovy does not like /cr line endings in maps. 738e3df CORE-840: map syntax 96b22bf CORE-840: Restore order 7efa3c2 CORE-840: global define TEST_ENVIRONMENT 7118393 CORE-840: syntax 87c2a54 CORE-840: Remove incomplete code section c08f058 CORE-840: First attempt at importing module and performing RESt APi commands to power controller. 522d976 Merge branch 'master' of hydra:jenkinsautobuild/hmb_se_d3000_autobuild_scripts into CORE-840 8240581 CORE-840: Amend Ethernet test executor selector key c1e39b1 CORE-840: Pull apart more Jenkin scripting to provide hardware information. WIP. dc01612 Merge commit '4726928776fe0eec1ffd4d0b1359aa8433556fc3' into production 21d2015 Merge commit '3acd68e06861ff17e6c290f3d6934ad861afd21c' 422246c Merge commit 'c53bc845e64272d84a1d1122c570c5cf41c7649f' 68d0259 Merge commit 'a9f3b337327cd6485eda53c584f53be0cbfe24d4' 56a3f99 Merge commit 'a149145f5868f6180de21787a59a0e23ec670fa0' fe278d3 Merge commit '74da6fb5165a582a74367040cc24620d12bf9ad6' 8cad087 Merge commit '868107b6f9f92da4aa237124e0db9dad761efb90' e1295cf Merge branch 'mcs2569' of hydra:jenkinsautobuild/MCS_Autobuild_Scripts into mcs2569 1a0b9d6 MCS-2569: Remove the reference object that is splatting the end of all builds. e66e021 Remove the reference object that is splatting the end of all builds. a5c41bc MCS-2569: Rename class to reference and then actuall commit all the files.... f09ddc7 MCS-2569: Refactor test where calls for checkForTestFailures is called. Now being called from imported module. e30197e MCS-2569: Return this module 7b2bead MCS-2569: more exploration into objects e0aebf9 Removed superfluous cat operation. 289e334 modified: Common_scripts/packaging/jsclient.groovy 3a34b1d Merged subtree Common_scripts - may have goofed on this one. 2d99967 CORE-816: Fixed an issue related to ordering or registers.js creation. Fixed an issue where variant subfolders don't exist. 9987f5a Fixed an minor issue in jsclient.groovy - which I thought had already been fixed. 7dd5239 actually push the script required by tests.... 7be48e2 CORE-816: Create register.js before overwrite by existing devjsclient. 07f5e5a CORE-816: Create register.js before overwrite by existing devjsclient. 94afc2c CORE-711: deal with product variants 5a757f9 Merge commit 'bd9d26eb2b833e5df1f57efe35f545992e9a7ca3' 5d8d5ab CORE-816: Create the registers.js file from combined_auto.json. 15f99ac CORE-816: Added some more output to the groovy script e130bcc CORE-816: First stab at a script to generate devjsclient folder 5b93a81 Merge commit '46493814f492eeafc61ba2c3088d839483e351b4' baee364 Merge commit '7697cc1882b1ac6e9846afdd29db8a9864f6a2ca' 3037559 Merge remote-tracking branch 'origin/production' 284551e Merge commit '4da27dd75092c954145686d9f35b8ecaccaa4dab' 32fb06c reverted Common_scripts/test/testethernetproduct.groovy to use CORE-98 branch of ftdi_relay 13b6721 reverted Common_scripts/test/testethernetproduct.groovy to use CORE-98 branch of ftdi_relay 87d7177 Added a web client, ftdi_relay_client.py, to control HMB power 33572fa Added a web client, ftdi_relay_client.py, to control HMB power 02d0306 Added a web client, ftdi_relay_client.py, to control HMB power 2b0542e Whitespace changes only c15beeb Merge commit '36802ccf8c7139e3dad8128baa199c0f5cf0842a' 1c966be Move specific cpd static analysis to common scripts e451ddb Merge commit '68b5afe7971ae13d55645fd0e0c1e00b0608df2c' 13a3343 Remove redundant echo 79a2a96 Merge remote-tracking branch 'origin/production' 35a5628 CORE-622 - Change paths to files to be stamped 9c063f2 Just to give a bit more info 6ce8338 Just to give a bit more info 1bb4e61 Merge commit '5a45df8c5d35d0591ea59382da9caf66a71385db' ccfc8cb Revert "HMBSI1536-420 - debug info." 737a7d8 Merge commit '9594b34aee5b9fc2ce556a7f0164b1578dd1b2e3' b8e7339 Merge commit '171916b45ef3bf4f1f79a14db4f41cea584b9ec0' 15afacd Merge remote-tracking branch 'origin/production' b7d0416 HMBSI1536-420 - debug info. git-subtree-dir: autobuild/Common_scripts git-subtree-split: 78da6d125ba0f26e8a4f3677e768dedd4e700e3f --- build/postactions.groovy | 7 +- import/importer.groovy | 46 +- meta/folder.groovy | 13 + packaging/jsclient.groovy | 85 + staticanalysis/cpd.groovy | 139 +- test/ethernettestlauncher.groovy | 116 + .../results/success/combined.json | 1955 +++++++++++++++++ ...un_mock_regression_test_and_succeed.groovy | 58 + test/powercontrollerutils.groovy | 166 ++ test/producttestjobinfo.groovy | 99 + test/storedproducttestresults.groovy | 40 + test/testUtils.groovy | 18 + test/testethernetproduct.groovy | 377 ++-- test/testprofileutils.groovy | 97 + test/testresourceselector.groovy | 23 + vertical_stack/build_all.groovy | 199 ++ vertical_stack/subcomponent_info.groovy | 93 + 17 files changed, 3332 insertions(+), 199 deletions(-) create mode 100644 test/ethernettestlauncher.groovy create mode 100644 test/mocktestinfo/results/success/combined.json create mode 100644 test/mocktestinfo/run_mock_regression_test_and_succeed.groovy create mode 100644 test/powercontrollerutils.groovy create mode 100644 test/producttestjobinfo.groovy create mode 100644 test/storedproducttestresults.groovy create mode 100644 test/testUtils.groovy create mode 100644 test/testprofileutils.groovy create mode 100644 test/testresourceselector.groovy create mode 100644 vertical_stack/build_all.groovy create mode 100644 vertical_stack/subcomponent_info.groovy diff --git a/build/postactions.groovy b/build/postactions.groovy index 3206004..94a63ca 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -11,10 +11,6 @@ "Description": "Can be empty - Static analysis job to run when this build is successful", "Job": "" }, - "Unit test": { - "Description": "Can be empty - Unit test job to run when this build is successful", - "Job": "" - }, "Regression test": { "Description": "Can be empty - Regression test job to run when this build is successful", "Job": "HMB_FD_HV_0.9.6/HMB_FD_HV_0.9.6_sg1024_run_tests" @@ -69,7 +65,7 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam if (params[alternativeparamname]) { jobname = params[alternativeparamname] } - } + } } if (jobname) { def jobitem = Jenkins.instance.getItemByFullName(jobname) @@ -125,7 +121,6 @@ def performSuccessfulBuildActions(meta) { def String buildselector = "${BUILD_NUMBER}" deployjob(meta, buildselector, postbuildactions, 'Deploy documentation', 'DOXYGEN_DEPLOY_JOB', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS', 'BUILD_JOB_WITH_DOXYGEN_ARTIFACTS_SELECTOR') deployjob(meta, buildselector, postbuildactions, 'Static analysis', 'STATIC_ANALYSIS_JOB', 'BUILD_JOB_TO_ANALYSE', 'BUILD_JOB_TO_ANALYSE_SELECTOR' ) - deployjob(meta, buildselector, postbuildactions, 'Unit test', 'UNIT_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') deployjob(meta, buildselector, postbuildactions, 'Regression test', 'REGRESSION_TEST_JOB', 'BUILD_JOB_TO_TEST', 'BUILD_JOB_TO_TEST_SELECTOR') deployjob(meta, buildselector, postbuildactions, 'Update differences', 'DIFF_JOB', 'LATER_BUILD_JOB', 'LATER_BUILD_SELECTOR', 'TOP_LEVEL_META_REPOSITORY') deployjob(meta, buildselector, postbuildactions, 'Release to git', 'RELEASE_TO_GIT_JOB', 'BUILD_JOB', 'BUILD_JOB_SELECTOR') diff --git a/import/importer.groovy b/import/importer.groovy index 439f788..e7e4f0c 100644 --- a/import/importer.groovy +++ b/import/importer.groovy @@ -118,16 +118,52 @@ class ImportOptions { m_appendtoparentmeta = appendtoparentmeta } - void jenkinsjob(String jobname, String buildnumberorselector) { + void jenkinsjob(String jobname, java.util.LinkedHashMap selector) { + m_script.echo("Jenkins job: ${jobname} Selector (${selector.getClass()}): ${selector}") + m_jobname = jobname.trim() - m_buildnumberorselector = [ - $class: 'ParameterizedBuildSelector', - parameterName: buildnumberorselector - ] + m_buildnumberorselector = selector + setsourceselect('Jenkins job artifact') + } + + void jenkinsjob(String jobname, String buildnumberorselector) { + m_script.echo("Jenkins job: ${jobname} Selector (String): ${buildnumberorselector}") + + m_jobname = jobname.trim() + // Yuk - nasty + // https://javadoc.jenkins.io/plugin/copyartifact/hudson/plugins/copyartifact/BuildSelector.html + // This selects buildselector class based on what is in the string parameter + if (buildnumberorselector.contains('')) { + m_script.echo("Constructing status build selector") + m_buildnumberorselector = [ + $class: 'ParameterizedBuildSelector', + parameterName: "${buildnumberorselector}" + ] + } else { + m_script.echo("Constructing specific build selector") + m_buildnumberorselector = [ + $class: 'ParameterizedBuildSelector', + parameterName: "${buildnumberorselector}" + ] + } setsourceselect('Jenkins job artifact') } void jenkinsjob(String jobname, int buildnumberorselector) { + m_script.echo("Jenkins job: ${jobname} Selector (int): ${buildnumberorselector}") + m_jobname = jobname.trim() m_buildnumberorselector = [ $class: 'ParameterizedBuildSelector', diff --git a/meta/folder.groovy b/meta/folder.groovy index f025c44..8d315bc 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -1,6 +1,9 @@ import java.nio.file.Paths import java.nio.file.Path import groovy.json.JsonSlurperClassic +import java.time.format.DateTimeFormatter +import java.time.LocalDateTime +import java.time.LocalDate abstract class GISJsonSerialised implements Serializable { def script @@ -242,6 +245,16 @@ class JenkinsBuildInfo extends GISJsonSerialised { return p } + LocalDateTime buildDateAsLocalDateTime() { + DateTimeFormatter builddateformatter = DateTimeFormatter.ofPattern('EEE LLL dd HH:mm:ss VV yyyy') + + return LocalDateTime.parse(builddate, builddateformatter) + } + + LocalDate buildDateAsLocalDate() { + return buildDateAsLocalDateTime().toLocalDate() + } + void deserialiseJson(rawmeta) { //format = rawmeta['format'] buildjobname = rawmeta['buildjobname'] diff --git a/packaging/jsclient.groovy b/packaging/jsclient.groovy index 916517c..798e6c8 100644 --- a/packaging/jsclient.groovy +++ b/packaging/jsclient.groovy @@ -38,6 +38,11 @@ pipeline { SOURCEREVISION = SOURCE_REVISION.trim() SOURCENAME = 'embedded software' configurationhelper.gitCheckoutAndRegister(meta, SOURCENAME, SOURCE_REPO, SOURCEREVISION, ESWDIR, '', 0, false) + + COREDIR = 'core' + CORESOURCEREVISION = CORE_SOURCE_REVISION.trim() + CORESOURCENAME = 'core software' + configurationhelper.gitCheckoutAndRegister(meta, CORESOURCENAME, CORE_SOURCE_REPO, CORESOURCEREVISION, COREDIR, '', 0, false) } } } @@ -82,6 +87,86 @@ pipeline { } else { jsclientzipname = "${PRODUCT_NAME}_${meta.buildstampinfo.buildstamp}_${plainzipname}" } + + // This is required to deal with cases such as HMB-FD-HV-SG600/SG1024 + combined_auto_json_file = "${WORKSPACE}/${ESWDIR}/HAL_Generator/combined_auto.json" + if (env.RELEASE_REPO_VARIANT_SUFFIX) { + combined_auto_json_file = "${WORKSPACE}/${ESWDIR}/HAL_Generator/${RELEASE_REPO_VARIANT_SUFFIX}/combined_auto.json" + } + // Another special case? This value is set in DHB-KM-XI (at least) for historical reasons. + // else if (env.PRINTHEAD_SOFTWARE_VARIANT) { + // combined_auto_json_file = "${WORKSPACE}/${ESWDIR}/HAL_Generator/${PRINTHEAD_SOFTWARE_VARIANT}/combined_auto.json" + // } + + // Some jiggery pokers to manufacture devjsclient folder for distribution. + if (isUnix()) { + def DEVJSDIR = "${WORKSPACE}/${ESWDIR}/devjsclient" + + sh """ + #!bin/bash --verbose + + # Preserve the contents of devjsclient so that unmodified products are unaffected. + # Recreate the folder so that we can populate it from the source folders. + if [ -d "${WORKSPACE}/${ESWDIR}/devjsclient" ] + then + echo "INF: Moving existing devjsclient folder to devjsclient_org" + mv ${WORKSPACE}/${ESWDIR}/devjsclient ${WORKSPACE}/${ESWDIR}/devjsclient_org + else + echo "INF: No existing devjsclient folder to preserve" + fi + mkdir ${WORKSPACE}/${ESWDIR}/devjsclient + + # Copy in the common Javascript and related files which live in the core repo. + if [ -d "${WORKSPACE}/${COREDIR}/client/javascript" ] + then + echo "INF: Copying core javascript files to devjsclient" + cp -r ${WORKSPACE}/${COREDIR}/client/javascript/* ${WORKSPACE}/${ESWDIR}/devjsclient + else + echo "ERR: Core javascript files don't exist!!!" + fi + + # Copy over the product-specific Javascript and related files. This may overwrite + # some or all of the core files, as well as adding new ones. + if [ -d "${WORKSPACE}/${ESWDIR}/client/javascript" ] + then + echo "INF: Copying product-specific javascript files over devjsclient" + cp -r ${WORKSPACE}/${ESWDIR}/client/javascript/* ${WORKSPACE}/${ESWDIR}/devjsclient + else + echo "INF: No product-specific javascript files to copy over devjsclient" + fi + + # Create (or overwrite) registers.js in the JS folder using the FPGA register definitions + # from the product repository. We also copy combined_auto.json (elsewhere) into the product + # distribution to go on the board, so dumptruck can download it. + echo "fpga_registers =" > ${DEVJSDIR}/registers.js + if [ -e ${combined_auto_json_file} ] + then + cat ${combined_auto_json_file} >> ${DEVJSDIR}/registers.js + else + # Fall back to default if variant subfolder does not exist (e.g. AHB-KM1024a). + cat ${WORKSPACE}/${ESWDIR}/HAL_Generator/combined_auto.json >> ${DEVJSDIR}/registers.js + fi + echo ";" >> ${DEVJSDIR}/registers.js + + # Restore the original devjsclient files, if it existed. This may overwrite some or all of the + # files from the previous steps. This included so the script will work for both + # modified and unmodified product repos. We can gradually trim out files which + # are duplicates of those in core, and also move files at some point to + # product/client/javascript + if [ -d "${WORKSPACE}/${ESWDIR}/devjsclient_org" ] + then + echo "INF: Copying original devjsclient files over recreated devjsclient" + cp -r ${WORKSPACE}/${ESWDIR}/devjsclient_org/* ${WORKSPACE}/${ESWDIR}/devjsclient + fi + """ + } + else { + bat """ + echo "Cannot be built on windows at the moment" + exit 1 + """ + } + dir(ESWDIR) { if (isUnix()) { sh """#!/bin/bash -v diff --git a/staticanalysis/cpd.groovy b/staticanalysis/cpd.groovy index c04649c..b0c535f 100644 --- a/staticanalysis/cpd.groovy +++ b/staticanalysis/cpd.groovy @@ -1,3 +1,85 @@ +def sourceinfostore = null + +/* Example expected JSON +{ + "Sources": [ + { + "name": "core", + "gituri": "git@hydra:core-presto/core-presto-embedded-software-subtree.git", + "revision": "origin/release" + }, + { + "name": "dhb-km-1024i", + "gituri": "git@hydra:dhb-km-1024i-source/dhb-km-1024i-embedded-software-subtree.git", + "revision": "origin/master" + }, + { + "name": "dhb-tt-cf3", + "gituri": "git@hydra:dhb-tt-cf3-source/dhb-tt-cf3-embedded-software-subtree.git", + "revision": "origin/master" + }, + { + "name": "emb", + "gituri": "git@hydra:emb-source/emb-source-embedded-software-subtree.git", + "revision": "origin/master" + }, + { + "name": "hmb-fd-hv-sg1024", + "gituri": "git@hydra:hmb-fd-hv-source/hmb-fd-hv-embedded-software-subtree.git", + "revision": "origin/master_sg1024" + }, + { + "name": "hmb-fd-hv-sg600", + "gituri": "git@hydra:hmb-fd-hv-source/hmb-fd-hv-embedded-software-subtree.git", + "revision": "origin/master_sg600" + }, + { + "name": "hmb-si-1536", + "gituri": "git@hydra:hmb-si-1536-source/hmb-si-1536-embedded-software-subtree.git", + "revision": "origin/master" + }, + { + "name": "sm-200", + "gituri": "git@hydra:sm-200-source/sm-200-source-embedded-software-subtree.git", + "revision": "origin/master" + }, + { + "name": "hmb-xr-5601", + "gituri": "git@hydra:hmb-xr-5601-source/hmb-xr-5601-embedded-software-subtree.git", + "revision": "origin/master" + } + ], + "Exclude_paths": [ + "core/utility/thirdparty" + ] +} +*/ + +def String asJsonText() { + return writeJSON(returnText: true, json: sourceinfostore, pretty: 1) +} + +def boolean exists() { + return (sourceinfostore != null) +} + +def set(String jsontext) { + sourceinfostore = readJSON(text: jsontext) + echo "Source info:\n${asJsonText()}" +} + +def get() { + return sourceinfostore +} + +def sources() { + return sourceinfostore['Sources'] +} + +def excludepaths() { + return sourceinfostore['Exclude_paths'] +} + pipeline { agent { label AGENT_LABEL } stages { @@ -5,6 +87,8 @@ pipeline { steps { script { meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + + set(SOURCE_INFO) } } } @@ -13,16 +97,6 @@ pipeline { script { configurationhelper = autobuilder.configurationhelper() - PYTHONURL = 'git@hydra:tools/python.git' - if (isUnix()) { - PYTHONBRANCH = 'origin/3.6.3_linux' - } else { - PYTHONBRANCH = 'origin/3.6.3_windows' - } - PYTHONDIR = "${WORKSPACE}/python" - configurationhelper.gitCheckoutAndRegister(meta, 'python', PYTHONURL, PYTHONBRANCH, PYTHONDIR) - env.PYTHON = "${PYTHONDIR}/ver/python.exe" - JAVAURL = 'git@hydra:tools/openjdk.git' if (isUnix()) { JAVABRANCH = 'origin/openjdk-11.0.2_linux-x64_bin' @@ -46,25 +120,13 @@ pipeline { } } } - stage('Checkout source') { - steps { - script { - SOURCEREVISION = "${SOURCE_REVISION}" - SOURCEDIR = "${WORKSPACE}/source" - configurationhelper.gitCheckoutAndRegister(meta, 'source', SOURCEURL, SOURCEREVISION, SOURCEDIR, '', 0, false) - SOURCE_PATH = "${SOURCEDIR}" - SRC = "${SOURCE_PATH}" - if (SOURCE_OFFSET_PATH) { - SRC += "/${SOURCE_OFFSET_PATH}" - } - } - } - } stage("Clean exports") { steps { script { + SRC = "${WORKSPACE}/cd" STATICANALYSIS = 'staticanalysis' cleanfolders = [ + SRC, STATICANALYSIS, ] cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") @@ -72,11 +134,22 @@ pipeline { } } } - stage('Generating version info') { + stage('Checkout product source') { steps { script { - version = load("${autobuilder.commonscripts()}/versionnumbering/generate.groovy") - version.generate(meta, SOURCE_REVISION, SOURCE_PATH) + if (SOURCE_OFFSET_PATH) { + SRC += "/${SOURCE_OFFSET_PATH}" + } + for(item in sources()) { + configurationhelper.gitCheckoutAndRegister(meta, + item['name'].trim(), + item['gituri'].trim(), + item['revision'].trim(), + "${SRC}/${item['name'].trim()}", + '', + 0, + false) + } } } } @@ -85,10 +158,9 @@ pipeline { script { def PPDFOLDER = "${STATICANALYSIS}/ppd" def EXCLUDE_PARAM = '' - if (EXCLUDE_PATHS) { + if (excludepaths()) { EXCLUDE_PARAM = '--exclude "' - def exclude_path_list = EXCLUDE_PATHS.split(',') - for (exclude_path in exclude_path_list) { + for (exclude_path in excludepaths()) { EXCLUDE_PARAM += "${SRC}/${exclude_path.trim()}," } EXCLUDE_PARAM += '"' @@ -104,7 +176,7 @@ pipeline { } else { bat """ mkdir -p "${PPDFOLDER}" - set PMD_JAVA_OPTS=-Xmx2048m + set PMD_JAVA_OPTS=-Xmx65536m "${PPD}/cpd.bat" --minimum-tokens 100 --files "${SRC}" --language cpp --format xml ${EXCLUDE_PARAM} --failOnViolation false > "${PPDFOLDER}/cpd.xml" """ } @@ -129,8 +201,7 @@ pipeline { script { ArrayList itemsForRelease = ["${STATICANALYSIS}/**"] def artifactlist = meta.generateartifacts(itemsForRelease) - artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(meta, artifactlist) + archiveArtifacts "${artifactlist}" } } } @@ -145,7 +216,7 @@ pipeline { unstable { echo 'Unstable build' } - success { + success { echo 'Succeeded build' } } diff --git a/test/ethernettestlauncher.groovy b/test/ethernettestlauncher.groovy new file mode 100644 index 0000000..e3bd47a --- /dev/null +++ b/test/ethernettestlauncher.groovy @@ -0,0 +1,116 @@ +import jenkins.model.Jenkins +def TEST_ENVIRONMENT; +pipeline { + agent { label AGENT_LABEL } + stages { + stage ("Initial Setup") { + steps{ + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + subJobs = [] + //Set the label of the build job to reflect what triggered the job to run. + try{ + currentBuild.description = "Running On ${env.NODE_NAME}, Triggered by ${currentBuild.upstreamBuilds[0].getFullDisplayName()}" + } + catch(Throwable e){ + currentBuild.description = "Running On ${env.NODE_NAME}, Triggered Directly" + } + } + } + } + stage ("Checkout test environment") { + steps { + script { + toolsimporter = load("${autobuilder.commonscripts()}/configuration/tools.groovy") + + def TEST_ENVIRONMENT_URL = 'git@hydra:gistest/jenkins-ethernet-test-environment.git' + def TEST_ENVIRONMENT_DIR = 'TestEnvironmentDir' + def TEST_ENVIRONMENT_REVISION = 'origin/master' + + def environmentoptions = toolsimporter.getNewToolOptions() + environmentoptions.toolName('Ethernet product test environment') + environmentoptions.toolRepo(TEST_ENVIRONMENT_URL, TEST_SOURCE_REVISION) + toolsimporter.getTool(meta, environmentoptions, TEST_ENVIRONMENT_DIR) + + TEST_ENVIRONMENT_FILE = "${TEST_ENVIRONMENT_DIR}/environment.json" + def alltestenvironment = readJSON(file: TEST_ENVIRONMENT_FILE) + + TEST_ENVIRONMENT = alltestenvironment[PRODUCT_NAME] + + echo "Selected environment:\n${TEST_ENVIRONMENT}" + } + } + } + stage ("Checkout dependencies") { + steps { + script { + def PYTHON_URL = 'git@hydra:tools/python.git' + if (isUnix()) { + PYTHON_REVISION = 'origin/3.6.3_linux' + } + else { + PYTHON_REVISION = 'origin/3.8.10_windows_for_test' + } + PYTHONDIR = "${WORKSPACE}/python" + + def pythonimportoptions = toolsimporter.getNewToolOptions() + pythonimportoptions.toolName('Python') + pythonimportoptions.toolRepo(PYTHON_URL, PYTHON_REVISION) + toolsimporter.getTool(meta, pythonimportoptions, PYTHONDIR) + if (isUnix()) { + env.PYTHON = "${PYTHONDIR}/usr/local/bin/python3" + } + else { + env.PYTHON = "${PYTHONDIR}/ver/python.exe" + } + + def CORE_SOURCE_URL = 'git@hydra:gistest/giscorelite.git' + env.GIS_TEST_SUITE_CORE = "${WORKSPACE}/GisCore" + + def coreimportoptions = toolsimporter.getNewToolOptions() + coreimportoptions.toolName('Test core') + coreimportoptions.toolRepo(CORE_SOURCE_URL, CORE_SOURCE_REVISION) + toolsimporter.getTool(meta, coreimportoptions, GIS_TEST_SUITE_CORE) + + } + } + } + stage('Perform CORE ethernet regression tests') { + steps { + script { + lock(TEST_ENVIRONMENT['RESOURCE_LOCK']) { + if (RUN_ETH_TESTS == 'true') { + EthTestJob = build ( + job: "HMB_SE_D3000_run_tests", + parameters: [ + string(name: 'TEST_SOURCE_REVISION', value: TEST_SOURCE_REVISION), + string(name: 'BUILD_JOB_TO_TEST', value: BUILD_JOB_TO_TEST), + string(name: 'BUILD_JOB_TO_TEST_SELECTOR', value: BUILD_JOB_TO_TEST_SELECTOR), + string(name: 'CORE_SOURCE_REVISION', value: CORE_SOURCE_REVISION), + booleanParam(name: 'CLEAN_WORKSPACE', value: CLEAN_WORKSPACE), + string(name: 'RELEASE_REPO', value: RELEASE_REPO), + string(name: 'PRODUCT_NAME', value: PRODUCT_NAME) + ], + propagate: false + ) + EthTestJobResults = load("${WORKSPACE}/autobuild/Common_scripts/test/testUtils.groovy").CheckForTestFailures(EthTestJob) + subJobs<<[ PrintHwTestJob, "EthTestJob", false, ] + } + } + } + } + } + stage("Archive test artifacts"){ + steps{ + script { + def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + artifactarchiver.archive(meta, artifactlist) + } + } + } + } +} + + + diff --git a/test/mocktestinfo/results/success/combined.json b/test/mocktestinfo/results/success/combined.json new file mode 100644 index 0000000..df71446 --- /dev/null +++ b/test/mocktestinfo/results/success/combined.json @@ -0,0 +1,1955 @@ +{ + "KY_remap": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.381985", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "KY_remap", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "barcodecolumnrows": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:01.134992", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodecolumnrows", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "barcodeoptions": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.346958", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodeoptions", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "barcodesdatamatrix": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 33, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:01.512991", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodesdatamatrix", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "barcodesv11": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.332995", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodesv11", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "barcodesv11ArbitraryNoRotate": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:06.391093", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodesv11ArbitraryNoRotate", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "barcodesv11ArbitraryRotate": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:06.329163", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "barcodesv11ArbitraryRotate", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "colourblocks": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:10.172008", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "colourblocks", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "csvdata": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.292003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "csvdata", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "csvdatautf8": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.299000", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "csvdatautf8", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "csvheaders": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.339999", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "csvheaders", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "csvtextheaders": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.360006", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "csvtextheaders", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "curvedsurfacelicense": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:02.716986", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "curvedsurfacelicense", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "fastbinarycrashKM1800": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:10.329230", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "fastbinarycrashKM1800", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "groupdirectionoffset": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:01:02.402993", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "groupdirectionoffset", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "hexachromeworkflow": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:22.800993", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "hexachromeworkflow", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "hexachromeworkflowErrorDiffusion": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:15.674996", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "hexachromeworkflowErrorDiffusion", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "hexachromeworkflowErrorDiffusion600": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:31.144999", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "hexachromeworkflowErrorDiffusion600", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "hexachromeworkflowErrorDiffusionLinear": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:30.874989", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "hexachromeworkflowErrorDiffusionLinear", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "iccprofile": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:51.935000", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "iccprofile", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "jobdeletion": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:11.764604", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "jobdeletion", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "labelcount": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:41.498990", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "labelcount", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "license_kerning": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.030992", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "license_kerning", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "lines": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.355008", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "lines", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "livestatus": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:15.682003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "livestatus", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "loadonimageabort": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:05:31.011365", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "loadonimageabort", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "loggermanagement": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:13.041995", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "loggermanagement", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "narrowcolumnrws": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.006004", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "narrowcolumnrws", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "printservermonitor": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:04:41.435646", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "printservermonitor", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "printstopping": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:17.401998", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "printstopping", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renamenodes": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:17.874976", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renamenodes", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderarbitraryrotation": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:30.832184", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderarbitraryrotation", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderbmp": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.387996", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderbmp", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderbmpbinarymode": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.370992", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderbmpbinarymode", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderbmpfastscreener": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:01.028007", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderbmpfastscreener", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "renderbmpmultiscreen": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.857013", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderbmpmultiscreen", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "rendercolumns": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:12.263913", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendercolumns", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderlinear": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.662012", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderlinear", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderondemand": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:48.537986", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderondemand", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderpages": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.399000", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderpages", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderpagesinx": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:05.721004", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderpagesinx", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderpreview": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.477008", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderpreview", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "renderrotatedbarcodes": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:01:38.453987", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "renderrotatedbarcodes", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendertestpatterns": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.452003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendertestpatterns", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendertiff": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:10.465993", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendertiff", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendertifgreyscale": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.340987", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendertifgreyscale", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendertotif": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:25.801997", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendertotif", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendervpi": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.378002", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendervpi", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendervpibinarymode": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.492009", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendervpibinarymode", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendervpigreyscaletif": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.426960", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendervpigreyscaletif", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "rendervpiperformance": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:11:45.141907", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendervpiperformance", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "rendervpirotatedpatterns": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:04.439998", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rendervpirotatedpatterns", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "restartleak": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:02:21.637000", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "restartleak", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "restartprint": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:03:37.817202", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "restartprint", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "rotatebmptif": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:06.397996", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "rotatebmptif", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "samegroupset": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:13.221002", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "samegroupset", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "saveconfiguration": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:31.999997", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "saveconfiguration", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "scanningfractionalprint": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:17.910800", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "scanningfractionalprint", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "selectivelogging": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:19.534006", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "selectivelogging", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "serialnumberdecrement": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:34.143000", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "serialnumberdecrement", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "serialnumberincrement": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:41.938004", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "serialnumberincrement", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "serialnumberlongdecrement": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:50.901001", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "serialnumberlongdecrement", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "serialnumberlongincrement": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:35.002003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "serialnumberlongincrement", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + }, + "spiralLicense": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:06.632163", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiralLicense", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "spiralflipx": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:09.614982", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiralflipx", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "spiraltest": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.570003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "spiraltest_canprint": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:01:48.074573", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest_canprint", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "FAILED" + }, + "spiraltest_nomultiplier": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.224003", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest_nomultiplier", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "FAILED" + }, + "spiraltest_optimised_canprint": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:23.799997", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest_optimised_canprint", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "FAILED" + }, + "spiraltest_optmized_nomultiplier": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:06.519994", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest_optmized_nomultiplier", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "FAILED" + }, + "spiraltest_shengfa": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:28.775997", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "spiraltest_shengfa", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "FAILED" + }, + "tcpipabort": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 2, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:18.297995", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "tcpipabort", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "tcpipescapesequences": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.133001", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "tcpipescapesequences", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "variabletextspacing": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.262001", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "variabletextspacing", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpiarithmetic": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:00.150004", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpiarithmetic", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpiimagemask": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.782996", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpiimagemask", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpimixedresolution": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:01:12.195390", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpimixedresolution", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpitransforms": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:08.368006", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpitransforms", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpiwidthchange": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 1, + "datetime": "2022-December-05-12:07:38", + "duration": "0:03:38.119999", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpiwidthchange", + "productInfo": "UNKNOWN", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "SUCCESS" + }, + "vpxunpack": { + "BuildInfo": { + "buildId": "4566", + "buildurl": "http://surtsey/job/PS_test_render_meta/4566", + "executor": "GREENFLY", + "jobName": "PS_test_render_meta" + }, + "TR_CaseIDs": null, + "TR_SuiteName": null, + "UseCases": { + "Failed": [], + "NotRun": [], + "Success": [] + }, + "Warnings": 3, + "datetime": "2022-December-05-12:07:38", + "duration": "0:00:03.381946", + "gitCommit": "dd74676433ae922539c50ebf076aa39bf7b3a39f", + "id": "vpxunpack", + "productVersion": { + "ps2": "2.0.50.21653" + }, + "result": "PASSED" + } +} diff --git a/test/mocktestinfo/run_mock_regression_test_and_succeed.groovy b/test/mocktestinfo/run_mock_regression_test_and_succeed.groovy new file mode 100644 index 0000000..5ca5442 --- /dev/null +++ b/test/mocktestinfo/run_mock_regression_test_and_succeed.groovy @@ -0,0 +1,58 @@ +import java.time.LocalDateTime + +def selectbuild(buildnumber) { + return "${buildnumber}" +} + +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + } + } + } + stage('Import build meta') { + steps { + script { + configurationhelper = autobuilder.configurationhelper() + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + + BUILDFOLDER = "${WORKSPACE}/build" + + def buildimportoptions = importer.getNewImportOptions() + buildimportoptions.jenkinsjob(BUILD_JOB_TO_TEST, BUILD_JOB_TO_TEST_SELECTOR) + buildimportoptions.setincrementversionnumber(false) + buildimportoptions.setfilter('meta/**') + buildmeta = importer.artifactimport(meta, buildimportoptions, BUILDFOLDER) + } + } + } + stage('Mock test') { + steps { + script { + echo "Mock test" + def srcpath = 'autobuild/Common_scripts/test/mocktestinfo/results/success' + def destpath = 'results' + echo("Copying from mock results folder: ${srcpath} to results folder: ${destpath} recursively") + fileOperations([ + folderCreateOperation(folderPath: destpath), + folderCopyOperation(sourceFolderPath: srcpath, destinationFolderPath: destpath) + ]) + } + } + } + stage('Archiving artifacts') { + steps { + script { + def artifacts = ['results/**'] + def artifactlist = meta.generateartifacts(artifacts) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + artifactarchiver.archive(meta, artifactlist) + } + } + } + } +} diff --git a/test/powercontrollerutils.groovy b/test/powercontrollerutils.groovy new file mode 100644 index 0000000..ef6e898 --- /dev/null +++ b/test/powercontrollerutils.groovy @@ -0,0 +1,166 @@ +//To Be called by the ethernet test jobs to perform REST actions against the relay controller +//Note, HTTP Calls only seem to be executed by the master node and not the slave. Therefore consider the networking environment. +import groovy.json.JsonSlurper + +def RawGet(url,timeout=5000){ + println(" Making Get to: " + url); + def returnObject = {}; + try{ + def get = new URL(url).openConnection(); + get.setReadTimeout(timeout); + get.setConnectTimeout(timeout); + def returnCode = get.getResponseCode(); + if (returnCode.equals(200)) { + r_returnString= get.getInputStream().getText(); + } + returnObject = [ + "code":returnCode, + "response":r_returnString]; + } + catch (SocketTimeoutException | ConnectException e){ + println("SocketTimeout or ConnectionException attempting to GET " + url); + returnObject = ["code":"0", + "response":"SocketTimeoutException"]; + } + catch( Exception e){ + println("Exception attempting to GET " + url); + returnObject = ["code":"0", + "response":"clientException"]; + throw (e) + } + return returnObject +} + +def HttpGet(url,timeout=5000){ + println(" Making Get to: " + url); + def returnObject = {}; + try{ + def get = new URL(url).openConnection(); + get.setReadTimeout(timeout); + get.setConnectTimeout(timeout); + def returnCode = get.getResponseCode(); + if (returnCode.equals(200)) { + r_returnString= get.getInputStream().getText(); + } + def parser = new JsonSlurper() + returnObject = [ + "code":returnCode, + "response":parser.parseText(r_returnString)]; + } + catch (SocketTimeoutException | ConnectException e){ + println("SocketTimeout or ConnectionException attempting to GET " + url); + returnObject = ["code":"0", + "response":"SocketTimeoutException"]; + } + catch( Exception e){ + println("Exception attempting to GET " + url); + returnObject = ["code":"0", + "response":"clientException"]; + throw (e) + } + return returnObject +} + +def NullPost(url,timeout=5000){ + println(" Making Post to: " + url); + def returnObject = {}; + try{ + def slurper = new JsonSlurper() + def post = new URL(url).openConnection(); + def message = '""' + post.setReadTimeout(timeout); + post.setConnectTimeout(timeout); + post.setRequestMethod("POST"); + post.setDoOutput(true); + post.setRequestProperty("Content-Type", "application/json"); + post.getOutputStream().write(message.getBytes("UTF-8")); + def returnCode = post.getResponseCode(); + if (returnCode.equals(200)) { + r_returnString= post.getInputStream().getText(); + } + def parser = new JsonSlurper() + returnObject = [ + "code":returnCode, + "response":parser.parseText(r_returnString)]; + return returnObject + } + catch (SocketTimeoutException | ConnectException e){ + println("SocketTimeout or ConnectionException attempting to POST " + url); + returnObject = ["code":"0", + "response":"SocketTimeoutException"]; + } + catch( Exception e){ + println("Exception attempting to POST " + url); + returnObject = ["code":"0", + "response":"clientException"]; + throw (e) + } + return returnObject +} + +def PowerDownHMB(Host,Device,Channel){ + // Send a power up request to the relay controller and device addressed in the profile. + def path = "http://" + Host + ":9001/api/powercontrollers/" + Device + "/switchOff/" + Channel + def response = NullPost(path); + println("PowerdownPost code is: " + response["code"]) + println("PowerdownPost reponse is: " + response["response"]) + + //Only Flag as working is the correct response it received. + if (response["response"]["name"] != "poweredDown"){ + return false; + } + else { + return true + } +} + +def PowerUpHMB(Host,Device,Channel){ + // Send a power up request to the relay controller and device addressed in the profile. + def path = "http://" + Host + ":9001/api/powercontrollers/" + Device + "/switchOn/" + Channel + def response = NullPost(path); + println("PowerupPost code is: " + response["code"]) + println("PowerupPost reponse is: " + response["response"]) + + //Only Flag as working is the correct response it received. + if (response["response"]["name"] != "poweredUp"){ + return false; + } + else { + return true + } +} + +def PollForLife(url, isJson = true,timeout = 24){ + //Hardcode to 2 minute timeout. Need to work out default values for arguments. + //simple polling loop to establish if an endpoint is available. + def returnVal = false; + for (int i = 0; i": "HMB_FD_HV_master/HMB_FD_HV_master_sg1024_run_tests", + "0.9.10.": "HMB_FD_HV_0.9.10/HMB_FD_HV_0.9.10_sg1024_run_tests" + }, + "sg600": { + "": "HMB_FD_HV_master/HMB_FD_HV_master_sg600_run_tests" + } + }, + "PRINT_SERVER": { + "": { + "": "Print_Server_master/Print_Server_master_test" + } + }, + "": { + "": { + "": "Generic_regression_test_job" + } + } + } +} +*/ + +def String asJsonText() { + return writeJSON(returnText: true, json: producttestinfostore, pretty: 1) +} + +def boolean exists() { + return (producttestinfostore != null) +} + +def set(String jsontext) { + producttestinfostore = readJSON(text: jsontext) + echo "Product test info:\n${asJsonText()}" +} + +def get() { + return producttestinfostore +} + +def productdetails(String productname) { + echo "Looking for product details associated with: ${productname} in: ${asJsonText()}" + pd = producttestinfostore[productname] + if (!pd) { + pd = producttestinfostore[''] + echo 'Found product details for: ' + } + echo "Product details for: ${productname}: ${pd}" + return pd +} + +def variantdetails(productdetails, String productvariant) { + echo "Looking for variant details associated with: ${productvariant} in ${productdetails}" + vd = productdetails[productvariant] + if (!vd) { + vd = productdetails[''] + echo 'Found variant details for: ' + } + echo "Variant details for: ${productvariant}: ${vd}" + return vd +} + +def buildstampprefixdetails(variantdetails, String buildstampprefix) { + echo "Looking for build stamp prefix associated with: ${buildstampprefix} in ${variantdetails}" + bspd = variantdetails[buildstampprefix] + if (!bspd) { + bspd = variantdetails[''] + echo 'Found build stamp prefix details for: ' + } + echo "Build stamp prefix details for: ${buildstampprefix}: ${bspd}}" + return bspd +} + +def getRegressionTestJobName(String productname, String productvariant, String buildstampprefix) { + if (!productname) { productname = '' } + if (!productvariant) { productvariant = '' } + if (!buildstampprefix) { buildstampprefix = '' } + + echo "Looking for Test Job suitable for product: ${productname} variant: ${productvariant} build stamp prefix: ${buildstampprefix}" + productinfo = productdetails(productname) + if (productinfo) { + productvariantinfo = variantdetails(productinfo, productvariant) + if (productvariantinfo) { + buildstampprefixinfo = buildstampprefixdetails(productvariantinfo, buildstampprefix) + if (buildstampprefixinfo) { + echo "Test Job suitable for product: ${productname} variant: ${productvariant} build stamp prefix: ${buildstampprefix} is: ${buildstampprefixinfo}" + return buildstampprefixinfo + } + } + } + return '' +} + +return this \ No newline at end of file diff --git a/test/storedproducttestresults.groovy b/test/storedproducttestresults.groovy new file mode 100644 index 0000000..efb31b6 --- /dev/null +++ b/test/storedproducttestresults.groovy @@ -0,0 +1,40 @@ +import java.time.LocalDateTime + +def m_testresultsstorepathroot = null + +def selectbuild(buildnumber) { + return "${buildnumber}" +} + +def handleresults(buildmeta, + boolean testsuccess, + importer, + regression_test_job, + String testresultsstorepathroot) { + m_testresultsstorepathroot = testresultsstorepathroot + if (testsuccess) { + def resultsimportoptions = importer.getNewImportOptions() + resultsimportoptions.jenkinsjob(regression_test_job.getProjectName(), selectbuild(regression_test_job.getNumber())) + resultsimportoptions.setincrementversionnumber(false) + resultsimportoptions.setfilter('meta/**') + testmeta = importer.artifactimport(meta, resultsimportoptions, ) + + testdate = testmeta.jenkinsbuildinfo.buildDateAsLocalDate().toString() + } else { + testdate = buildmeta.jenkinsbuildinfo.buildDateAsLocalDate().toString() + } + productname = buildmeta.productinfo.productname + productvariant = buildmeta.productinfo.variant + buildstampprefix = buildmeta.buildstampinfo.buildstampprefix + + RESULTS_FOLDER = "${m_testresultsstorepathroot}/${testdate}/${productname}/${(productvariant) ? productvariant : '-' }/${buildstampprefix}" + + if (testsuccess) { + def resultsimportoptions2 = importer.getNewImportOptions() + resultsimportoptions2.jenkinsjob(regression_test_job.getProjectName(), selectbuild(regression_test_job.getNumber())) + resultsimportoptions2.setincrementversionnumber(false) + testmeta2 = importer.artifactimport(meta, resultsimportoptions2, RESULTS_FOLDER) + } +} + +return this \ No newline at end of file diff --git a/test/testUtils.groovy b/test/testUtils.groovy new file mode 100644 index 0000000..a0e0109 --- /dev/null +++ b/test/testUtils.groovy @@ -0,0 +1,18 @@ +//To be called by test master jobs, Evaluates the results of a lower meta build to identify if is passed of failed so that it will ripple up the stack. + +def CheckForTestFailures(TestObject) { + if (TestObject.result == 'UNSTABLE') { + unstable("Tests Failed ${TestObject.getProjectName()}") + } + else if (TestObject.result == 'SUCCESS') { + echo("Tests Passed ${TestObject.getProjectName()}") + } else { + error("Tests Job ${TestObject.getProjectName()} Failure with result ${TestObject.result}! Investigate Job/Slave Setup") + } +} + + +//Setup like a model where you can return yourself allow access to methods and objects contained +testUtils = this; + +return this; \ No newline at end of file diff --git a/test/testethernetproduct.groovy b/test/testethernetproduct.groovy index 5e2ce53..6eeaaef 100644 --- a/test/testethernetproduct.groovy +++ b/test/testethernetproduct.groovy @@ -1,12 +1,21 @@ import jenkins.model.Jenkins - +def TEST_ENVIRONMENT; pipeline { agent { label AGENT_LABEL } stages { stage ("Initial Setup") { steps{ script { + //Load the common build tools. meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startnonbuild(this) + subJobs = [] + //Set the label of the build job to reflect what triggered the job to run. + try{ + currentBuild.description = "Running On ${env.NODE_NAME}, Triggered by ${currentBuild.upstreamBuilds[0].getFullDisplayName()}" + } + catch(Throwable e){ + currentBuild.description = "Running On ${env.NODE_NAME}, Triggered Directly" + } } } } @@ -25,180 +34,240 @@ pipeline { toolsimporter.getTool(meta, environmentoptions, TEST_ENVIRONMENT_DIR) TEST_ENVIRONMENT_FILE = "${TEST_ENVIRONMENT_DIR}/environment.json" - def alltestenvironment = readJSON(file: "${TEST_ENVIRONMENT_FILE}") - TEST_ENVIRONMENT = alltestenvironment[ETHERNET_PRODUCT_TO_RUN_TEST] + def alltestenvironment = readJSON(file: TEST_ENVIRONMENT_FILE) + //TODO: Configure the build jobs to submit the product name only of the resource we wish to query e.g. HMB_SE_D3000, not HMB_SE_D3000_2 + //TEST_ENVIRONMENT = load("${autobuilder.commonscripts()}/test/testresourceselector.groovy").LocateResources(ETHERNET_PRODUCT_TO_RUN_TEST) + + TEST_ENVIRONMENT = alltestenvironment[PRODUCT_NAME] + //HMBUtils = load("${autobuilder.commonscripts()}/test/powercontrollerutils.groovy") echo "Selected environment:\n${TEST_ENVIRONMENT}" } } } - stage ('Setup') { - agent { label TEST_ENVIRONMENT['FTDI_AGENT'] } - stages { - stage ("Checkout dependencies") { - steps { - script { - def PYTHON_URL = 'git@hydra:tools/python.git' - if (isUnix()) { - PYTHON_REVISION = 'origin/3.6.3_linux' - } - else { - PYTHON_REVISION = 'origin/3.8.10_windows_for_test' - } - PYTHONDIR = "${WORKSPACE}/python" - - def pythonimportoptions = toolsimporter.getNewToolOptions() - pythonimportoptions.toolName('Python') - pythonimportoptions.toolRepo(PYTHON_URL, PYTHON_REVISION) - toolsimporter.getTool(meta, pythonimportoptions, PYTHONDIR) - if (isUnix()) { - env.PYTHON = "${PYTHONDIR}/usr/local/bin/python3" - } - else { - env.PYTHON = "${PYTHONDIR}/ver/python.exe" - } - - def TEST_SOURCE_URL = 'git@hydra:hmb_regression/hmb_tests.git' - TEST_SUITE_DIR = 'TestSuiteDir' - env.GIS_TEST_SUITE_HOME = "${WORKSPACE}/${TEST_SUITE_DIR}" - - def regressiontestimportoptions = toolsimporter.getNewToolOptions() - regressiontestimportoptions.toolName('Tests') - regressiontestimportoptions.toolRepo(TEST_SOURCE_URL, TEST_SOURCE_REVISION) - toolsimporter.getTool(meta, regressiontestimportoptions, GIS_TEST_SUITE_HOME) - - env.HISTORY_FOLDER = "${WORKSPACE}/testhistory" - - def resultimportoptions = toolsimporter.getNewToolOptions() - resultimportoptions.toolName('Test history') - resultimportoptions.toolRepo(HISTORY_REPO, HISTORY_REVISION) - toolsimporter.getTool(meta, resultimportoptions, HISTORY_FOLDER) - - def CORE_SOURCE_URL = 'git@hydra:gistest/giscorelite.git' - env.GIS_TEST_SUITE_CORE = "${WORKSPACE}/GisCore" - - def coreimportoptions = toolsimporter.getNewToolOptions() - coreimportoptions.toolName('Test core') - coreimportoptions.toolRepo(CORE_SOURCE_URL, CORE_SOURCE_REVISION) - toolsimporter.getTool(meta, coreimportoptions, GIS_TEST_SUITE_CORE) - - def FTDI_SOURCE_URL = 'git@hydra:python_scripts/ftdi_relay.git' - def FTDI_SOURCE_REVISION = 'origin/Core-98' - FTDI_SOURCE_DIR = "${WORKSPACE}/PowerController" - - def ftdiimportoptions = toolsimporter.getNewToolOptions() - ftdiimportoptions.toolName('FTDI relay driver') - ftdiimportoptions.toolRepo(FTDI_SOURCE_URL, FTDI_SOURCE_REVISION) - toolsimporter.getTool(meta, ftdiimportoptions, FTDI_SOURCE_DIR) - - def HISTORY_PROCESSING_REPO = 'git@hydra:gistestresults/ethernet-products-history-processing.git' - HISTORY_PROCESSING_DIR = "${WORKSPACE}/HistoryProcessing" - - def resultprocessingoptions = toolsimporter.getNewToolOptions() - resultprocessingoptions.toolName('History processing') - resultprocessingoptions.toolRepo(HISTORY_PROCESSING_REPO, HISTORY_PROCESSING_REVISION) - toolsimporter.getTool(meta, resultprocessingoptions, HISTORY_PROCESSING_DIR) - } + stage ("Checkout dependencies") { + steps { + script { + def PYTHON_URL = 'git@hydra:tools/python.git' + if (isUnix()) { + PYTHON_REVISION = 'origin/3.6.3_linux' } - } - stage ("Import application to test") { - steps { - script { - importer = load("${autobuilder.commonscripts()}/import/importer.groovy") - - APPLICATION_UNDER_TEST = 'application_under_test' - env.APPLICATION_ARTIFACT_FOLDER = "${WORKSPACE}/${APPLICATION_UNDER_TEST}" - - def applicationimportoptions = importer.getNewImportOptions() - applicationimportoptions.jenkinsjob(APPLICATION_ARTIFACT_PROJECT, APPLICATION_ARTIFACT_SELECTOR) - applicationimportoptions.setfilter('app_package/**,control_package/**') - applicationmeta = importer.artifactimport(meta, applicationimportoptions, APPLICATION_ARTIFACT_FOLDER) - - meta.productinfo.set(applicationmeta.productinfo) - meta.productinfo.subcomponentname = "${applicationmeta.productinfo.subcomponentname}_TEST" - meta.gitinfo.set(applicationmeta.gitinfo) - meta.buildstampinfo.set(applicationmeta.buildstampinfo) - } + else { + PYTHON_REVISION = 'origin/3.8.10_windows_for_test' } - } - stage("Clean") { - steps { - script { - LOGGING_ROOT = 'Logging' - env.GIS_TEST_OUTPUT_LOGGING_ROOT = "${WORKSPACE}/${LOGGING_ROOT}" - cleanfolders = [ - GIS_TEST_OUTPUT_LOGGING_ROOT, - ] - cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") - cleaner.clean(cleanfolders) - } + PYTHONDIR = "${WORKSPACE}/python" + + def pythonimportoptions = toolsimporter.getNewToolOptions() + pythonimportoptions.toolName('Python') + pythonimportoptions.toolRepo(PYTHON_URL, PYTHON_REVISION) + toolsimporter.getTool(meta, pythonimportoptions, PYTHONDIR) + if (isUnix()) { + env.PYTHON = "${PYTHONDIR}/usr/local/bin/python3" } + else { + env.PYTHON = "${PYTHONDIR}/ver/python.exe" + } + + def TEST_SOURCE_URL = 'git@hydra:hmb_regression/hmb_tests.git' + TEST_SUITE_DIR = 'TestSuiteDir' + env.GIS_TEST_SUITE_HOME = "${WORKSPACE}/${TEST_SUITE_DIR}" + + def regressiontestimportoptions = toolsimporter.getNewToolOptions() + regressiontestimportoptions.toolName('Tests') + regressiontestimportoptions.toolRepo(TEST_SOURCE_URL, TEST_SOURCE_REVISION) + toolsimporter.getTool(meta, regressiontestimportoptions, GIS_TEST_SUITE_HOME) + + //env.HISTORY_FOLDER = "${WORKSPACE}/testhistory" + //HISTORY_REVISION = + //HISTORY_REPO + + //def resultimportoptions = toolsimporter.getNewToolOptions() + //resultimportoptions.toolName('Test history') + //resultimportoptions.toolRepo(HISTORY_REPO, HISTORY_REVISION) + //toolsimporter.getTool(meta, resultimportoptions, HISTORY_FOLDER) + + def CORE_SOURCE_URL = 'git@hydra:gistest/giscorelite.git' + env.GIS_TEST_SUITE_CORE = "${WORKSPACE}/GisCore" + + def coreimportoptions = toolsimporter.getNewToolOptions() + coreimportoptions.toolName('Test core') + coreimportoptions.toolRepo(CORE_SOURCE_URL, CORE_SOURCE_REVISION) + toolsimporter.getTool(meta, coreimportoptions, GIS_TEST_SUITE_CORE) + + //def HISTORY_PROCESSING_REPO = 'git@hydra:gistestresults/ethernet-products-history-processing.git' + //HISTORY_PROCESSING_DIR = "${WORKSPACE}/HistoryProcessing" + + //def resultprocessingoptions = toolsimporter.getNewToolOptions() + //resultprocessingoptions.toolName('History processing') + //resultprocessingoptions.toolRepo(HISTORY_PROCESSING_REPO, HISTORY_PROCESSING_REVISION) + //toolsimporter.getTool(meta, resultprocessingoptions, HISTORY_PROCESSING_DIR) } - stage ('Test') { - steps { - script { - lock(TEST_ENVIRONMENT['RESOURCE_LOCK']) { - if (POWER_CYCLE_HARDWARE == 'true') { - dir(FTDI_SOURCE_DIR) { - bat """ - "${PYTHON}" "${FTDI_SOURCE_DIR}/RegressionPower.py" -d ${TEST_ENVIRONMENT['FTDI_RELAY_DEVICE']} -o True - """ - } - } - if (UPDATE_HARDWARE == 'true') { - dir(GIS_TEST_SUITE_CORE) { - bat """ - "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbPackageDeployer.py" -p "${APPLICATION_ARTIFACT_FOLDER}" -t "${TEST_ENVIRONMENT['IP_ADDRESS']}" - """ - rc = bat (script:""" - "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbinspectstate.py" - """, - returnStatus: true) - if (rc == 1) { - unstable('FAILED while inspecting state of hardware') - } - } - } - if (DO_TEST == 'true') { - rc = bat(script:""" - ${PYTHON} "${GIS_TEST_SUITE_CORE}/GISTestMaster.py" -w ${PRODUCT_LOCATION_UNDER_TEST} -fl --include ${TEST_INCLUDE_FILTER} - """, - returnStatus: true - ) - if (rc == 1) { - unstable('FAILED while running tests') - } - } + } + } + stage ("Import application to test") { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + + APPLICATION_UNDER_TEST = 'application_under_test' + env.APPLICATION_ARTIFACT_FOLDER = "${WORKSPACE}/${APPLICATION_UNDER_TEST}" + + def applicationimportoptions = importer.getNewImportOptions() + applicationimportoptions.jenkinsjob(APPLICATION_ARTIFACT_PROJECT, APPLICATION_ARTIFACT_SELECTOR) + applicationimportoptions.setfilter('app_package/**,control_package/**') + applicationmeta = importer.artifactimport(meta, applicationimportoptions, APPLICATION_ARTIFACT_FOLDER) + + meta.productinfo.set(applicationmeta.productinfo) + meta.productinfo.subcomponentname = "${applicationmeta.productinfo.subcomponentname}_TEST" + meta.gitinfo.set(applicationmeta.gitinfo) + meta.buildstampinfo.set(applicationmeta.buildstampinfo) + } + } + } + stage("Clean") { + steps { + script { + LOGGING_ROOT = 'Logging' + env.GIS_TEST_OUTPUT_LOGGING_ROOT = "${WORKSPACE}/${LOGGING_ROOT}" + cleanfolders = [ + GIS_TEST_OUTPUT_LOGGING_ROOT, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage ('Update HMB and Run Tests') { + steps { + script { + //Set 3 Hour timeout. + timeout(180){ + //load the hmb utils onto the node that is using them. + HMBUtils = load("${autobuilder.commonscripts()}/test/powercontrollerutils.groovy"); + env.SM_IP_ADDRESS = TEST_ENVIRONMENT["SM_200"]["IP_ADDRESS"]; + env.HMB_IP_ADDRESS = TEST_ENVIRONMENT["IP_ADDRESS"]; + SMReady = bat (script:""" + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbpollforlife.py" -t "${SM_IP_ADDRESS}" + """, + returnStatus: true + ) + if (0 != SMReady){ + HMBUtils.PowerUpHMB( + TEST_ENVIRONMENT["SM_200"]['POWER_CONTROLLER']["HOST"], + TEST_ENVIRONMENT["SM_200"]['POWER_CONTROLLER']["NAME"], + TEST_ENVIRONMENT["SM_200"]['POWER_CONTROLLER']["CHANNEL"]); + SMReady = bat (script:""" + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbpollforlife.py" -t "${SM_IP_ADDRESS}" + """, + returnStatus: true + ); + println("SMReady is..." ); + println(SMReady); + if (0 != SMReady ){ + error("Unable to get SM200 into correct state.") } } - } - } - stage("Archive Test History") { - steps{ - script { - dir(HISTORY_FOLDER) { - rc = bat (script:""" - "${PYTHON}" "${HISTORY_PROCESSING_DIR}/GitCyclicPush.py" - """, - returnStatus: true + else { + println("SM detected at ${SM_IP_ADDRESS}") + } + if (POWER_CYCLE_HARDWARE == 'true') { + println("Attempted to turn on HMB") + HMBUtils.PowerDownHMB( + TEST_ENVIRONMENT['POWER_CONTROLLER']["HOST"], + TEST_ENVIRONMENT['POWER_CONTROLLER']["NAME"], + TEST_ENVIRONMENT['POWER_CONTROLLER']["CHANNEL"] + ) + } + //Always turn the hardware back on. + HMBUtils.PowerUpHMB( + TEST_ENVIRONMENT['POWER_CONTROLLER']["HOST"], + TEST_ENVIRONMENT['POWER_CONTROLLER']["NAME"], + TEST_ENVIRONMENT['POWER_CONTROLLER']["CHANNEL"] + ) + + Ready = bat (script:""" + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbpollforlife.py" -t "${HMB_IP_ADDRESS}" + """, + returnStatus: true + ) + if (Ready != 0){ + error("unable to get hardware at address" + TEST_ENVIRONMENT["IP_ADDRESS"] + "into a known state before upgrade."); + } + else { + println("hardware at address" + TEST_ENVIRONMENT["IP_ADDRESS"] + "is available and ready for next steps."); + } + if (UPDATE_HARDWARE == 'true') { + println("Updating Hardware") + dir(GIS_TEST_SUITE_CORE) { + bat """ + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbPackageDeployer.py" -p "${APPLICATION_ARTIFACT_FOLDER}" -c -t "${TEST_ENVIRONMENT['IP_ADDRESS']}" + """ + Ready = bat (script:""" + "${PYTHON}" "${GIS_TEST_SUITE_CORE}/HMBCommon/hmbpollforlife.py" -t "${HMB_IP_ADDRESS}" + """, + returnStatus: true ) - if (rc == 1) { - unstable('FAILED to process history') + if (Ready != 0){ + error("unable to get hardware at address" + TEST_ENVIRONMENT["IP_ADDRESS"] + "into a known state before upgrade."); } } } + TestSuiteProfileUtils = load("${autobuilder.commonscripts()}/test/testprofileutils.groovy") + def TEST_PRODUCT_NAME = TestSuiteProfileUtils.LookUpProduct(PRODUCT_NAME) + def PRODUCT_UNDER_TEST = TestSuiteProfileUtils.LookUpTestArgument(PRODUCT_NAME) + def TEST_INCLUDE_FILTER = TestSuiteProfileUtils.LookUpTestFilter(PRODUCT_NAME) + + println("Swapping target Ipaddress on target to match that which is configured in test profile.") + rc = bat(script:""" + ${PYTHON} "${GIS_TEST_SUITE_CORE}/HMBCommon/swapconfig.py" -p ${TEST_PRODUCT_NAME} -t "${HMB_IP_ADDRESS}" + """, + returnStatus: true + ) + if (rc != 0) { + error('Failed to update test profile, client will miss target hardware.') + } + + + + if (DO_TEST == 'true') { + rc = bat(script:""" + ${PYTHON} "${GIS_TEST_SUITE_CORE}/GISTestMaster.py" ${PRODUCT_UNDER_TEST} installed -fl --include ${TEST_INCLUDE_FILTER} + """, + returnStatus: true + ) + if (rc == 1) { + unstable('FAILED while running tests') + } + } } } - stage("Archive test artifacts"){ - steps{ - script { - def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) - artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") - artifactarchiver.archive(meta, artifactlist) + } + } + /*stage("Archive Test History") { + steps{ + script { + dir(HISTORY_FOLDER) { + rc = bat (script:""" + "${PYTHON}" "${HISTORY_PROCESSING_DIR}/GitCyclicPush.py" + """, + returnStatus: true + ) + if (rc == 1) { + unstable('FAILED to process history') } } } } } + */ + stage("Archive test artifacts"){ + steps{ + script { + def artifactlist = meta.generateartifacts([ "${LOGGING_ROOT}/**"]) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + artifactarchiver.archive(meta, artifactlist) + } + } + } } } diff --git a/test/testprofileutils.groovy b/test/testprofileutils.groovy new file mode 100644 index 0000000..abf36d2 --- /dev/null +++ b/test/testprofileutils.groovy @@ -0,0 +1,97 @@ + +import java.nio.file.Paths +import groovy.json.JsonSlurper +import groovy.json.JsonOutput + +def SwapHMBTarget(testCoreRoot,profileName,product,NewTarget){ + //To support both the static profile model and dynamic changing of target IP address, jenkins must swap the target Ip address of the file. + println("Updating ${product} IP for profile ${profileName} to ${NewTarget}."); + def parser = new JsonSlurper() + def ProfilePath = "${testCoreRoot}/CoreUtils/machineprofiles/${profileName}.json" + println("Selected path " + ProfilePath + " HMB IP address too " + NewTarget) + + JsonData = parser.parse(new File (ProfilePath)); + println(JsonData) + JsonData[product]["Address"] = NewTarget; + println(JsonData) + File Writefile = new File(ProfilePath); + Writefile.write(JsonOutput.prettyPrint(JsonOutput.toJson(JsonData))); + println("Updating " + ProfilePath + "Complete") + return; +} + +def LookUpProduct(JenkinsProductKey,variant=""){ + //TODO Unify this with test profiles to avoid repetition and mapping. + //Translates from Autobuild Product name to test profile HMB entity name. + def ProductLookup = [ + "HMB-SE-D3000":"HMB_SE_D3000", + "HMB-SE-S800":"HMB_SE_S800", + "HMB-FD-HV":[ + "sg600":"HMB_FD_HV", + "sg1024":"HMB_FD_HV", + ], + "AHB-KM-1024A": [ + "she":"AHB_KM_1024A", + "lhg":"AHB_KM_1024A" + ], + "HMB-SI-1536":"HMB_SI_1536", + "HMB-KY-M16ST":"HMB_KY_M16ST" + ]; + return ProductLookup[JenkinsProductKey] +} + +def LookUpTestArgument(JenkinsProductKey,variant=""){ + //Translates from Autobuild Product name to include filter for tests targetting that product. + def TestFilters = [ + "HMB-SE-D3000":"--hmbsed3000", + "HMB-SE-S800":"--hmbses800", + "HMB-FD-HV":[ + "sg600":"--hmbsg600", + "sg1024":"hmbsg1024", + ], + "AHB-KM-1024A": [ + "she":"--hmbkm1024a", + "lhg":"--hmbkm1024a" + ], + "HMB-SI-1536":"--hmbsi1536", + "HMB-KY-M16ST":"--hmbkym16st" + ]; + return TestFilters[JenkinsProductKey] +} + +def LookUpTestFilter(JenkinsProductKey,variant=""){ + //Translates from Autobuild Product name to include filter for tests targetting that product. + def TestFilters = [ + "HMB-SE-D3000":".*d3000", + "HMB-SE-D3000":".*s800", + "HMB-FD-HV":[ + "sg600":".*sg600", + "sg1024":".*sg1024", + ], + "AHB-KM-1024A": [ + "she":".*km1024a", + "lhg":".*km1024a" + ], + "HMB-SI-1536":".*si1536", + "HMB-KY-M16ST":".*kym16st" + ]; + if (variant == ""){ + return TestFilters[JenkinsProductKey] + } + else{ + TestFilters[JenkinsProductKey][variant] + } +} + +def ReverseProduct(TestProductKey){ + //TODO Unify this with test profiles to avoid repetition and mapping. + //Translates from test profile HMB entity name to Autobuild Product name. + def ReverseProductLookup = ["HMB_SE_D3000":"HMB-SE-D3000", + ]; + return ReverseProductLookup[JenkinsProductKey] +} + + +testprofileutilsutils = this; + +return this; \ No newline at end of file diff --git a/test/testresourceselector.groovy b/test/testresourceselector.groovy new file mode 100644 index 0000000..89c030e --- /dev/null +++ b/test/testresourceselector.groovy @@ -0,0 +1,23 @@ +//To be called by the ethernet test script to query for a usable resource. +def LocateResources(AllTestEnvironmentPath,TargetHardware){ + def AllTestEnvironements = readJSON(AllTestEnvironmentPath); + +} + +// GET +def DoGET(url){ + def get = new URL(url).openConnection(); + def getRC = get.getResponseCode(); + + if (getRC.equals(200)) { + def Response = get.getInputStream().getText(); + } + else{ + def Response = "Request Failed" + echo("REST: received ${getRC} from GET to ${url}"); + } + echo("REST: received ${getRC} from GET to ${url}"); +} + +TestResourceUnpacker = this; +return this; \ No newline at end of file diff --git a/vertical_stack/build_all.groovy b/vertical_stack/build_all.groovy new file mode 100644 index 0000000..6e51c1e --- /dev/null +++ b/vertical_stack/build_all.groovy @@ -0,0 +1,199 @@ +def selectbuild(buildnumber) { + return "${buildnumber}" +} + +pipeline { + agent { label AGENT_LABEL } + stages { + stage('Initial setup') { + steps { + script { + meta = load("${WORKSPACE}/autobuild/Common_scripts/autobuilder.groovy").startbuild(this, PRODUCT_NAME, SUBCOMPONENT_NAME, RELEASE_REPO) + + subcomponentinfo = load("${autobuilder.commonscripts()}/vertical_stack/subcomponent_info.groovy") + subcomponentinfo.set(SUB_COMPONENT_INFO) + } + } + } + stage("Clean exports") { + steps { + script { + ATLASDEST = "atlas" + MCSDEST = "mcs" + PDFRSDEST = "pdfrs" + HMBDEST = "hmb" + SMDEST = "sm" + IMBDEST = "imb" + cleanfolders = [ + ATLASDEST, + MCSDEST, + PDFRSDEST, + HMBDEST, + SMDEST, + IMBDEST, + ] + cleaner = load("${autobuilder.commonscripts()}/clean/clean.groovy") + cleaner.clean(cleanfolders) + } + } + } + stage('Setup environment') { + steps { + script { + importer = load("${autobuilder.commonscripts()}/import/importer.groovy") + artifactFolders = new ArrayList() + meta.buildstampinfo.set(BUILD_STAMP_PREFIX) + } + } + } + stage('Import') { + failFast true + parallel { + stage('Import Atlas UI and Atlas Services') { + steps { + script { + def atlasinfo = subcomponentinfo.namedartifactinfo('ATLAS_UI') + + def atlasimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(atlasimportoptions, atlasinfo) + atlasimportoptions.setincrementversionnumber(true) + atlasimportoptions.setnested(true) + atlasbuildmeta = importer.artifactimport(meta, atlasimportoptions, ATLASDEST) + + artifactFolders.add("${ATLASDEST}/**") + + mcsbuiltforatlasui = subcomponentinfo.useAtlasServicesBuiltWithAtlasUI() + if (mcsbuiltforatlasui) { + // Import MCS from the related component + def mcsimportoptions = importer.getNewImportOptions() + mcsimportoptions.setsourceselect(atlasinfo.artifactlocation()) + mcsimportoptions.setincrementversionnumber(true) + mcsimportoptions.setnested(true) + asbuildmeta = importer.artifactimport(meta, atlasbuildmeta, ATLASDEST, 'ATLAS_SERVICES', 'WHOLE', mcsimportoptions, MCSDEST) + } else { + def mcsinfo = subcomponentinfo.namedartifactinfo('ATLAS_SERVICES') + // Import MCS from the component parameter + def mcsimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(mcsimportoptions, mcsinfo) + mcsimportoptions.setincrementversionnumber(true) + mcsimportoptions.setnested(true) + asbuildmeta = importer.artifactimport(meta, mcsimportoptions, MCSDEST) + } + + artifactFolders.add("${MCSDEST}/**") + } + } + } + stage('Import PDF RS') { + steps { + script { + def pdfrsinfo = subcomponentinfo.namedartifactinfo('PDF_RENDER_SERVER') + + def pdfrsimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(pdfrsimportoptions, pdfrsinfo) + pdfrsimportoptions.setincrementversionnumber(true) + pdfrsimportoptions.setnested(true) + importer.artifactimport(meta, pdfrsimportoptions, PDFRSDEST) + + artifactFolders.add("${PDFRSDEST}/**") + } + } + } + stage('Import HMB') { + steps { + script { + def hmbinfo = subcomponentinfo.namedartifactinfo('HEAD_MANAGER_BOARD') + + def hmbimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(hmbimportoptions, hmbinfo) + hmbimportoptions.setincrementversionnumber(true) + hmbimportoptions.setnested(true) + importer.artifactimport(meta, hmbimportoptions, HMBDEST) + + artifactFolders.add("${HMBDEST}/**") + } + } + } + stage('Import SM') { + steps { + script { + def sminfo = subcomponentinfo.namedartifactinfo('SYSTEM_MANAGER') + + def smimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(smimportoptions, sminfo) + smimportoptions.setincrementversionnumber(true) + smimportoptions.setnested(true) + importer.artifactimport(meta, smimportoptions, SMDEST) + + artifactFolders.add("${SMDEST}/**") + } + } + } + stage('Import IMB') { + steps { + script { + def imbinfo = subcomponentinfo.namedartifactinfo('INK_MANAGER_BOARD') + + def imbimportoptions = importer.getNewImportOptions() + subcomponentinfo.source(imbimportoptions, imbinfo) + imbimportoptions.setincrementversionnumber(true) + imbimportoptions.setnested(true) + importer.artifactimport(meta, imbimportoptions, IMBDEST) + + artifactFolders.add("${IMBDEST}/**") + } + } + } + } + } + stage('Build integrity check') { + steps { + script { + def integrity = load("${autobuilder.commonscripts()}/build/integrity.groovy") + def results = integrity.check(meta) + if (!results.good) { + unstable("Build integrity check failed: \n ${results.comment}") + } + } + } + } + stage('Classifying publishable artifacts') { + steps { + script { + def publishable = [] + def publishutils = load("${autobuilder.commonscripts()}/publishing/utils.groovy") + publishutils.generatelist(meta, publishable) + } + } + } + stage('Archiving artifacts') { + steps { + script { + def artifactlist = meta.generateartifacts([], artifactFolders) + artifactarchiver = load("${autobuilder.commonscripts()}/artifacts/archiver.groovy") + artifactarchiver.archive(meta, artifactlist) + } + } + } + } + post { + always { + echo 'Post-build' + } + failure { + echo 'Failed build' + script { + load("${autobuilder.commonscripts()}/build/postactions.groovy").performFailedBuildActions(meta) + } + } + unstable { + echo 'Unstable build' + } + success { + echo 'Succeeded build' + script { + load("${autobuilder.commonscripts()}/build/postactions.groovy").performSuccessfulBuildActions(meta) + } + } + } +} diff --git a/vertical_stack/subcomponent_info.groovy b/vertical_stack/subcomponent_info.groovy new file mode 100644 index 0000000..4634820 --- /dev/null +++ b/vertical_stack/subcomponent_info.groovy @@ -0,0 +1,93 @@ +def verticalstackinfostore = null + +/* Example expected JSON +{ + "COMPONENTS" : { + "ATLAS_UI": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "Atlas_3.0.9/Atlas_3.0.9_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:atlas-ui-releases/atlas_ui_whole.git", + "RELEASE_REVISION": "refs/tags/3.0.9.52395_53" + }, + "ATLAS_SERVICES": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "MCS_1.0.9/MCS_1.0.9_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:atlas-services-releases/atlas_services_whole.git", + "RELEASE_REVISION": "refs/tags/1.0.3.1292_54" + }, + "PDF_RENDER_SERVER": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "PDF_Render_Server_1.0.3/PDF_Render_Server_1.0.3_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:pdf-render-server-releases/pdf_render_server_whole.git", + "RELEASE_REVISION": "refs/tags/1.0.3.1292_54" + }, + "HEAD_MANAGER_BOARD": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "HMB_SE_D3000_0.9.13/HMB_SE_D3000_0.9.13_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:hmb_se_d3000-releases/hmb_se_d3000_whole.git", + "RELEASE_REVISION": "refs/tags/0.9.9.8897_2" + }, + "SYSTEM_MANAGER": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "SM200_1.1.0/SM200_1.1.0_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:sm200-releases/sm200_whole.git", + "RELEASE_REVISION": "refs/tags/1.0.6.31386_8" + }, + "INK_MANAGER_BOARD": { + "ARTIFACT_LOCATION": "Release repository", + "BUILD_JOB": "IMB_1.5.18/IMB_1.5.18_build", + "BUILD_JOB_SELECTOR": "true", + "RELEASE_REPO": "git@hydra:imb-releases/imb_whole.git", + "RELEASE_REVISION": "refs/tags/1.5.18.21422_40" + } + }, + "USE_ATLAS_SERVICES_BUILT_WITH_ATLAS_UI": true +} +*/ + +def String asJsonText() { + return writeJSON(returnText: true, json: verticalstackinfostore, pretty: 1) +} + +def boolean exists() { + return (verticalstackinfostore != null) +} + +def set(String jsontext) { + verticalstackinfostore = readJSON(text: jsontext) + echo "Vertical stack info:\n${asJsonText()}" +} + +def get() { + return verticalstackinfostore +} + +def namedartifactinfo(componentname) { + return verticalstackinfostore['COMPONENTS'][componentname] +} + +def String artifactlocation(namedartifactinfo) { + return namedartifactinfo['ARTIFACT_LOCATION'] +} + +def source(importoptions, namedartifactinfo) { + importoptions.source( + artifactlocation(namedartifactinfo), + namedartifactinfo['BUILD_JOB'], + namedartifactinfo['BUILD_JOB_SELECTOR'], + namedartifactinfo['RELEASE_REPO'], + namedartifactinfo['RELEASE_REVISION'] + ) +} + +def boolean useAtlasServicesBuiltWithAtlasUI() { + return verticalstackinfostore['USE_ATLAS_SERVICES_BUILT_WITH_ATLAS_UI'] +} + + +return this \ No newline at end of file From 1d31bfd79a66a48ed9c269cb3e99e18833e0b062 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 8 Jan 2023 18:09:49 +0000 Subject: [PATCH 7/9] Git LFS not installing on windows powershell --- autobuild/Common_scripts/versioncontrol/git.groovy | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autobuild/Common_scripts/versioncontrol/git.groovy b/autobuild/Common_scripts/versioncontrol/git.groovy index bd389c3..60dd011 100644 --- a/autobuild/Common_scripts/versioncontrol/git.groovy +++ b/autobuild/Common_scripts/versioncontrol/git.groovy @@ -102,7 +102,7 @@ def String checkouttoreporoot(String gitURL) { branches: [ [name: 'origin/master'] ], - doGenerateSubmoduleConfigurations: false, + doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'GitLFSPull'], [$class: 'CleanBeforeCheckout'], @@ -134,6 +134,7 @@ def String checkouttoreporoot(String gitURL) { } def checkgitlfsinstall() { + echo "Doing: git lfs install" if (isUnix()) { sh """ git lfs install @@ -142,6 +143,8 @@ def checkgitlfsinstall() { } else { powershell """ + git config --unset core.hooksPath + if (\$lastexitcode -ge 1) { exit 1 } git lfs install if (\$lastexitcode -ge 1) { exit 1 } """ @@ -307,7 +310,7 @@ def gitsparserestore(String targetDir) { def List convertSparseItemsString(String itemstopublish) { def List sparsepaths = [] - + boolean nonempty = itemstopublish?.trim() if (nonempty) { def String[] items = itemstopublish.trim().split(',') From 97353182fe1fceec4abcea62c79e9a62156f1642 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 8 Jan 2023 18:24:03 +0000 Subject: [PATCH 8/9] Git LFS not installing on windows powershell --- autobuild/Common_scripts/versioncontrol/git.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/autobuild/Common_scripts/versioncontrol/git.groovy b/autobuild/Common_scripts/versioncontrol/git.groovy index 60dd011..9725650 100644 --- a/autobuild/Common_scripts/versioncontrol/git.groovy +++ b/autobuild/Common_scripts/versioncontrol/git.groovy @@ -144,7 +144,6 @@ def checkgitlfsinstall() { } else { powershell """ git config --unset core.hooksPath - if (\$lastexitcode -ge 1) { exit 1 } git lfs install if (\$lastexitcode -ge 1) { exit 1 } """ From 4e46881ae9d1484c5868af070a45346ff1a6c1e9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 8 Jan 2023 18:34:25 +0000 Subject: [PATCH 9/9] Squashed 'autobuild/Common_scripts/' changes from 78da6d1..9a7161e 9a7161e Git LFS not installing on windows powershell 75631d9 Git LFS not installing on windows powershell e652bd6 Merge commit '616c8b13a0ac8724042d688529a9f472ac8c7c2d' b236c7c Correct merge dcccf93 Merge commit 'a88d5c4c23c582ef4b89d3188eacbcf4a5e4968e' 5322cab Merge commit '21b372134d83845304e09f49882cbd648d9468b3' git-subtree-dir: autobuild/Common_scripts git-subtree-split: 9a7161e06c7dfcbe0f59b6f263512f2e473499cf --- versioncontrol/git.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index bd389c3..9725650 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -102,7 +102,7 @@ def String checkouttoreporoot(String gitURL) { branches: [ [name: 'origin/master'] ], - doGenerateSubmoduleConfigurations: false, + doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'GitLFSPull'], [$class: 'CleanBeforeCheckout'], @@ -134,6 +134,7 @@ def String checkouttoreporoot(String gitURL) { } def checkgitlfsinstall() { + echo "Doing: git lfs install" if (isUnix()) { sh """ git lfs install @@ -142,6 +143,7 @@ def checkgitlfsinstall() { } else { powershell """ + git config --unset core.hooksPath git lfs install if (\$lastexitcode -ge 1) { exit 1 } """ @@ -307,7 +309,7 @@ def gitsparserestore(String targetDir) { def List convertSparseItemsString(String itemstopublish) { def List sparsepaths = [] - + boolean nonempty = itemstopublish?.trim() if (nonempty) { def String[] items = itemstopublish.trim().split(',')