From 47ab9a83b418216ba67333311eeee6fd139a3e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 16 Jan 2019 15:10:22 +0100 Subject: [PATCH] use larger number fo builds for comment tempalting tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- test/comments.js | 23 ++++++++++++++------- test/sample.js | 54 +++++++++++------------------------------------- 2 files changed, 27 insertions(+), 50 deletions(-) diff --git a/test/comments.js b/test/comments.js index eae5496..9fa7515 100644 --- a/test/comments.js +++ b/test/comments.js @@ -12,28 +12,35 @@ const COMMENT = ` ### Jenkins Builds | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| -| :heavy_check_mark: | COMMIT-1 | [ID-1](URL-1) | 2018-12-20 08:26:33 | DURATION-1 | \`PLATFORM-1\` | [:package: package](PKG_URL-1) | -| | | | | | | | -| :x: | COMMIT-2 | [ID-2](URL-2) | 2018-12-20 08:45:28 | DURATION-2 | \`PLATFORM-2\` | [:page_facing_up: build log](URL-2consoleText) | +| :heavy_check_mark: | COMMIT-0 | [ID-1](URL-1) | 2018-12-20 08:25:56 | DURATION-1 | \`PLATFORM-1\` | [:package: package](PKG_URL-1) | +| :heavy_check_mark: | COMMIT-0 | [ID-2](URL-2) | 2018-12-20 08:26:53 | DURATION-2 | \`PLATFORM-2\` | [:package: package](PKG_URL-2) | ` const COMMENT_FOLDED = ` ### Jenkins Builds
-Click to see older builds (2) +Click to see older builds (7) | :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| -| :heavy_check_mark: | COMMIT-1 | [ID-1](URL-1) | 2018-12-20 08:26:33 | DURATION-1 | \`PLATFORM-1\` | [:package: package](PKG_URL-1) | +| :heavy_check_mark: | COMMIT-0 | [ID-1](URL-1) | 2018-12-20 08:25:56 | DURATION-1 | \`PLATFORM-1\` | [:package: package](PKG_URL-1) | +| :heavy_check_mark: | COMMIT-0 | [ID-2](URL-2) | 2018-12-20 08:26:53 | DURATION-2 | \`PLATFORM-2\` | [:package: package](PKG_URL-2) | +| :x: | COMMIT-0 | [ID-3](URL-3) | 2018-12-20 08:27:50 | DURATION-3 | \`PLATFORM-3\` | [:page_facing_up: build log](URL-3consoleText) | | | | | | | | | -| :x: | COMMIT-2 | [ID-2](URL-2) | 2018-12-20 08:45:28 | DURATION-2 | \`PLATFORM-2\` | [:page_facing_up: build log](URL-2consoleText) | +| :heavy_check_mark: | COMMIT-1 | [ID-4](URL-4) | 2018-12-20 08:28:47 | DURATION-4 | \`PLATFORM-4\` | [:package: package](PKG_URL-4) | +| :heavy_check_mark: | COMMIT-1 | [ID-5](URL-5) | 2018-12-20 08:29:43 | DURATION-5 | \`PLATFORM-5\` | [:package: package](PKG_URL-5) | +| :x: | COMMIT-1 | [ID-6](URL-6) | 2018-12-20 08:30:40 | DURATION-6 | \`PLATFORM-6\` | [:page_facing_up: build log](URL-6consoleText) | +| :heavy_check_mark: | COMMIT-1 | [ID-7](URL-7) | 2018-12-20 08:31:37 | DURATION-7 | \`PLATFORM-7\` | [:package: package](PKG_URL-7) |
| :grey_question: | Commit | :hash: | Finished (UTC) | Duration | Platform | Result | |-|-|-|-|-|-|-| -| :heavy_check_mark: | COMMIT-3 | [ID-3](URL-3) | 2018-12-20 08:26:32 | DURATION-3 | \`PLATFORM-3\` | [:package: package](PKG_URL-3) | +| :heavy_check_mark: | COMMIT-2 | [ID-8](URL-8) | 2018-12-20 08:32:34 | DURATION-8 | \`PLATFORM-8\` | [:package: package](PKG_URL-8) | +| :x: | COMMIT-2 | [ID-9](URL-9) | 2018-12-20 08:33:31 | DURATION-9 | \`PLATFORM-9\` | [:page_facing_up: build log](URL-9consoleText) | +| :heavy_check_mark: | COMMIT-2 | [ID-10](URL-10) | 2018-12-20 08:34:27 | DURATION-10 | \`PLATFORM-10\` | [:package: package](PKG_URL-10) | +| :heavy_check_mark: | COMMIT-2 | [ID-11](URL-11) | 2018-12-20 08:35:24 | DURATION-11 | \`PLATFORM-11\` | [:package: package](PKG_URL-11) | | | | | | | | | -| :x: | COMMIT-4 | [ID-4](URL-4) | 2018-12-20 08:45:23 | DURATION-4 | \`PLATFORM-4\` | [:page_facing_up: build log](URL-4consoleText) | +| :x: | COMMIT-3 | [ID-12](URL-12) | 2018-12-20 08:36:21 | DURATION-12 | \`PLATFORM-12\` | [:page_facing_up: build log](URL-12consoleText) | ` describe('Comments', () => { diff --git a/test/sample.js b/test/sample.js index 52db64c..60d8de7 100644 --- a/test/sample.js +++ b/test/sample.js @@ -9,48 +9,18 @@ const BUILD = { pkg_url: 'https://example.com/some/pkg/path', } -const BUILDS = [ - { - id: 'ID-1', - commit: 'COMMIT-1', - success: true, - platform: 'PLATFORM-1', - duration: 'DURATION-1', - url: 'URL-1', - pkg_url: 'PKG_URL-1', - meta: { created: 1545294393058 }, - }, - { - id: 'ID-2', - commit: 'COMMIT-2', - success: false, - platform: 'PLATFORM-2', - duration: 'DURATION-2', - url: 'URL-2', - pkg_url: 'PKG_URL-2', - meta: { created: 1545295528896 }, - }, - { - id: 'ID-3', - commit: 'COMMIT-3', - success: true, - platform: 'PLATFORM-3', - duration: 'DURATION-3', - url: 'URL-3', - pkg_url: 'PKG_URL-3', - meta: { created: 1545294392930 }, - }, - { - id: 'ID-4', - commit: 'COMMIT-4', - success: false, - platform: 'PLATFORM-4', - duration: 'DURATION-4', - url: 'URL-4', - pkg_url: 'PKG_URL-4', - meta: { created: 1545295523333 }, - }, -] +const getBuild = (idx) => ({ + id: `ID-${idx}`, + commit: `COMMIT-${Math.floor(idx/4)}`, + success: (idx%3) ? true : false, + platform: `PLATFORM-${idx}`, + duration: `DURATION-${idx}`, + url: `URL-${idx}`, + pkg_url: `PKG_URL-${idx}`, + meta: { created: 1545294300000+(idx*56789) }, +}) + +const BUILDS = Array.apply(null, Array(12)).map((v,i)=>getBuild(i+1)) const COMMENTS = [ { pr: 'PR-1', comment_id: 1234 },