jekyll-report-dashboard 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37dfe1321be323ff5fde2c21d81d8ddc40f1a84cd8aa56c49fa1d25e5c977d2f
4
- data.tar.gz: 0c303b7139b6e76a77a9569b355d3056dbb2508cb183b8df942b8a8ef4f0e603
3
+ metadata.gz: 6d4b5a6daa60c59253441b9de704ff8e554ab2f161fb644392287e1e53834dd6
4
+ data.tar.gz: d29064e6f4ead4a47578407a60a17c8018504169f0a4591893af4d82a24be336
5
5
  SHA512:
6
- metadata.gz: b7945b9284fa48fd3764a4e84f3d20c891c0e00cc87eb7f9a1ea26102584d7477500aff6a444613c9b458b4f3b151315966c38bca0b20361cf456527b6ff1a57
7
- data.tar.gz: 1c6de21c442cc2c74a5a0151fdd566b4f4cef1fafcc29fdd7acd4555eff6883d63c3132ba709f684412af3f5e7129b6a41f54a019e5a541f91d24dfedc700b8e
6
+ metadata.gz: d12dc4bed1b6d7eb22a7e81a573f7d07e77a7fe535cde784b83f4c3cd180e02256f1a3781bd97cc7d65802ef4d53361ce65c221352ef73ac0495e80ea83975b3
7
+ data.tar.gz: cc0e43b4abd749fcaa65f4722ea80937efeba418bc6eb59ea84e61f4c977296dd73d967ac217ccbb25dcff2e89648ee4179747639c78dca7727eb8aa70c890de
@@ -14,8 +14,17 @@
14
14
  <!-- Liquid provides a helper method to capitalize text -->
15
15
  {{ name | capitalize }}
16
16
  </div>
17
+ {% capture status %}
18
+ {% if values.pct >= site.coverage.pass.[name] %}
19
+ text-pass
20
+ {% elsif values.pct > site.coverage.fail.[name] %}
21
+ text-warn
22
+ {% else %}
23
+ text-fail
24
+ {% endif %}
25
+ {% endcapture %}
17
26
  <!-- use the custom coverage_status filter with the stat name to get the correct styling for the percent -->
18
- <div class="font-bold text-xl @sm:text-2xl @md:text-3xl @lg:text-4xl {{ values.pct | coverage_status: name }}">
27
+ <div class="font-bold text-xl @sm:text-2xl @md:text-3xl @lg:text-4xl {{ status }}">
19
28
  <!-- Liquid provides a helper method for rounding floats to a number -->
20
29
  {{ values.pct | round: 1 }}%
21
30
  </div>
@@ -1,7 +1,7 @@
1
1
  {% if include.data %}
2
- <!-- use the custom normalize_playwright filter to get the status, total number of tests, errors, and test statistics from the data -->
3
- {% assign results = include.data | normalize_playwright %}
4
2
  <!-- if the data was included, display the summary -->
3
+ {% assign results = include.data %}
4
+ {% assign total = results.stats.expected + results.stats.unexpected + results.stats.skipped + results.stats.flaky %}
5
5
  <div class="@container flex flex-col mb-8">
6
6
  <div class="mt-4 py-1 @sm:py-2 px-2 @sm:px-4 font-light text-[0.6rem] @sm:text-xs text-tertiary border border-outline border-b-0 rounded-t-md bg-highlight flex flex-row justify-between">
7
7
  <!-- if the run_id was included, display it in the header of the summary -->
@@ -14,13 +14,28 @@
14
14
  <span></span>
15
15
  {% endif %}
16
16
  <!-- Liquid provides a helper method for formatting dates -->
17
- <span>Run At: {{ results.startTime | date: "%Y-%m-%d %H:%M %Z" }}</span>
17
+ <span>Run At: {{ results.stats.startTime | date: "%Y-%m-%d %H:%M %Z" }}</span>
18
18
  </div>
19
19
  <div class="pt-2 @sm:pt-4 pb-1 @sm:pb-2 text-xs @sm:text-sm leading-normal border border-outline rounded-b-md flex items-center justify-around">
20
- <!-- style the icon according to the report status and use the custom status_icon filter to return the correct svg -->
21
- <span class="w-10 @sm:w-12 h-10 @sm:h-12 {{results.status}}">{{ results.status | status_icon }}</span>
20
+ <!-- style the icon according to the report status and use the correct svg -->
21
+ {% capture status_icon %}
22
+ {% if results.stats.unexpected > 0 %}
23
+ <svg aria-hidden='true' class="fill-fail' height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
24
+ <path fillRule='evenodd' d='M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z'></path>
25
+ </svg>
26
+ {% elsif results.errors.size == 0 %}
27
+ <svg aria-hidden='true' class="fill-pass" height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
28
+ <path fillRule='evenodd' d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'></path>
29
+ </svg>
30
+ {% else %}
31
+ <svg aria-hidden='true' class="fill-warn" height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
32
+ <path fillRule='evenodd' d='M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z'></path>
33
+ </svg>
34
+ {% endif %}
35
+ {% endcapture %}
36
+ <span class="w-10 @sm:w-12 h-10 @sm:h-12">{{ status_icon }}</span>
22
37
  <div class="py-1 @md:py-2 w-2/3 @sm:w-4/5">
23
- {% if results.status == "warn" %}
38
+ {% if status == "warn" %}
24
39
  <!-- if there are errors, there won't be any test statistics, so only display the errors -->
25
40
  <div class="py-1 @md:py-2 px-0 font-mono flex flex-col gap-4">
26
41
  {% for error in results.errors %}
@@ -31,11 +46,11 @@
31
46
  {% else %}
32
47
  <!-- if there are no errors, display the test statistics -->
33
48
  <div class="min-w-full font-medium leading-8 grid grid-cols-1 grid-rows-5 @lg:grid-cols-5 @lg:grid-rows-1 justify-center">
34
- {% include playwright-stat.html label="All" value=results.total %}
35
- {% include playwright-stat.html label="Passed" value=results.expected %}
36
- {% include playwright-stat.html label="Failed" value=results.unexpected %}
37
- {% include playwright-stat.html label="Flaky" value=results.flaky %}
38
- {% include playwright-stat.html label="Skipped" value=results.skipped %}
49
+ {% include playwright-stat.html label="All" value=total %}
50
+ {% include playwright-stat.html label="Passed" value=results.stats.expected %}
51
+ {% include playwright-stat.html label="Failed" value=results.stats.unexpected %}
52
+ {% include playwright-stat.html label="Flaky" value=results.stats.flaky %}
53
+ {% include playwright-stat.html label="Skipped" value=results.stats.skipped %}
39
54
  </div>
40
55
  {% endif %}
41
56
 
@@ -16,6 +16,10 @@
16
16
  --color-highlight: var(--color-gray-100);
17
17
  --color-outline: var(--color-gray-300);
18
18
 
19
+ --color-pass: var(--color-green-700);
20
+ --color-fail: var(--color-red-600);
21
+ --color-warn: var(--color-amber-400);
22
+
19
23
  --breakpoint-sm: 40rem; /* 640px */
20
24
  --breakpoint-md: 48rem; /* 768px */
21
25
  --breakpoint-lg: 64rem; /* 1024px */
@@ -214,18 +218,6 @@
214
218
  }
215
219
  }
216
220
 
217
- .pass {
218
- color: var(--color-green-700);
219
- }
220
-
221
- .fail {
222
- color: var(--color-red-600);
223
- }
224
-
225
- .warn {
226
- color: var(--color-amber-400);
227
- }
228
-
229
221
  .gh-markdown-content {
230
222
  width: 100%;
231
223
  overflow-x: auto;
metadata CHANGED
@@ -1,14 +1,42 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-report-dashboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiffany Forkner
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-26 00:00:00.000000000 Z
10
+ date: 2025-03-27 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: jekyll
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: 4.4.1
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: 4.4.1
26
+ - !ruby/object:Gem::Dependency
27
+ name: jekyll-tailwindcss
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
12
40
  - !ruby/object:Gem::Dependency
13
41
  name: bundler
14
42
  requirement: !ruby/object:Gem::Requirement
@@ -29,8 +57,6 @@ executables: []
29
57
  extensions: []
30
58
  extra_rdoc_files: []
31
59
  files:
32
- - 404.html
33
- - _data/coverage/thresholds.yml
34
60
  - _includes/coverage-summary.html
35
61
  - _includes/footer.html
36
62
  - _includes/head.html
@@ -44,17 +70,7 @@ files:
44
70
  - _layouts/playwright-branch.html
45
71
  - _layouts/post.html
46
72
  - _layouts/release-note.html
47
- - _plugins/coverage-results-filter.rb
48
- - _plugins/icon-filter.rb
49
- - _plugins/key-list-filter.rb
50
- - _plugins/playwright-branch-index-generator.rb
51
- - _plugins/playwright-results-filter.rb
52
73
  - assets/css/styles.css
53
- - coverage.markdown
54
- - index.markdown
55
- - playwright-branches.markdown
56
- - playwright-reports.markdown
57
- - releases.markdown
58
74
  homepage: https://github.com/FearlessSolutions/jekyll-report-dashboard
59
75
  licenses:
60
76
  - MIT
data/404.html DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- permalink: /404.html
3
- layout: default
4
- ---
5
-
6
- <div class="my-3 mx-auto max-w-[37.5rem] text-center">
7
- <h1 class="my-8 text-6xl leading-none tracking-tighter">404</h1>
8
-
9
- <p><strong>Page not found :(</strong></p>
10
- <p>The requested page could not be found.</p>
11
- </div>
@@ -1,11 +0,0 @@
1
- pass:
2
- lines: 90
3
- functions: 85
4
- statements: 90
5
- branches: 80
6
-
7
- fail:
8
- lines: 70
9
- functions: 65
10
- statements: 70
11
- branches: 60
@@ -1,15 +0,0 @@
1
- module Jekyll
2
- module CoverageResultFilter
3
- def coverage_status(input, name)
4
- if input >= @context.registers[:site].data["coverage"]["thresholds"]["pass"][name]
5
- "pass"
6
- elsif input >= @context.registers[:site].data["coverage"]["thresholds"]["fail"][name]
7
- "warn"
8
- else
9
- "fail"
10
- end
11
- end
12
- end
13
- end
14
-
15
- Liquid::Template.register_filter(Jekyll::CoverageResultFilter)
@@ -1,22 +0,0 @@
1
- module Jekyll
2
- module IconFilter
3
- def status_icon(input)
4
- case input
5
- when "pass"
6
- "<svg aria-hidden='true' fill='currentColor' height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
7
- <path fillRule='evenodd' d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z'></path>
8
- </svg>"
9
- when "fail"
10
- "<svg aria-hidden='true' fill='currentColor' height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
11
- <path fillRule='evenodd' d='M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z'></path>
12
- </svg>"
13
- when "warn"
14
- "<svg aria-hidden='true' fill='currentColor' height='100%' width='100%' viewBox='0 0 16 16' version='1.1'>
15
- <path fillRule='evenodd' d='M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z'></path>
16
- </svg>"
17
- end
18
- end
19
- end
20
- end
21
-
22
- Liquid::Template.register_filter(Jekyll::IconFilter)
@@ -1,14 +0,0 @@
1
- module Jekyll
2
- module KeyFilter
3
- def key_list(input)
4
- return if input.nil?
5
- keys = []
6
- input.each_key do |key|
7
- keys.push(key)
8
- end
9
- keys
10
- end
11
- end
12
- end
13
-
14
- Liquid::Template.register_filter(Jekyll::KeyFilter)
@@ -1,28 +0,0 @@
1
- module Jekyll
2
- class BranchIndex < Page
3
- def initialize(site, base, dir, branch)
4
- @site = site
5
- @base = base
6
- @dir = dir
7
- @name = 'index.html'
8
-
9
- self.process(@name)
10
- self.read_yaml(File.join(base, '_layouts'), 'playwright-branch.html')
11
- self.data['branch'] = branch
12
- end
13
- end
14
-
15
- class BranchIndexGenerator < Generator
16
- safe true
17
-
18
- def generate(site)
19
- if site.layouts.key? 'playwright-branch'
20
- dir = "/playwright-reports/branches"
21
- site.data["playwright-reports"]["branches"].each_key do |branch|
22
- Jekyll.logger.info "Branch Index: Generating index for #{branch}"
23
- site.pages << BranchIndex.new(site, site.source, File.join(dir, branch), branch)
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,36 +0,0 @@
1
- module Jekyll
2
- module PlaywrightResultFilter
3
- def normalize_playwright(input)
4
- status = playwright_status(input)
5
- total = playwright_total(input)
6
- stats = input["stats"]
7
- stats["errors"] = input["errors"]
8
- stats["total"] = total
9
- stats["status"] = status
10
- stats
11
- end
12
-
13
- def playwright_total(input)
14
- if input["errors"].size > 0
15
- 0
16
- else
17
- input["stats"]["expected"] + input["stats"]["unexpected"] + input["stats"]["skipped"] + input["stats"]["flaky"]
18
- end
19
- end
20
-
21
- def playwright_status(input)
22
- if input["stats"]["unexpected"] > 0
23
- # if the unexpected results is greater than one, return fail
24
- "fail"
25
- elsif input["errors"].size == 0
26
- # if there are no unexpected results and no errors, return pass
27
- "pass"
28
- else
29
- # otherwise if there are errors, return error
30
- "warn"
31
- end
32
- end
33
- end
34
- end
35
-
36
- Liquid::Template.register_filter(Jekyll::PlaywrightResultFilter)
data/coverage.markdown DELETED
@@ -1,14 +0,0 @@
1
- ---
2
- layout: page
3
- # the header for the page
4
- title: "Code Coverage Report"
5
- # the link to page https://jekyllrb.com/docs/permalinks/
6
- permalink: coverage-report/
7
- ---
8
-
9
- <div>
10
- <!-- Get the data from the `total` field in `_data/coverage/coverage-summary.json` and assign it to a variable called `total`. -->
11
- {% assign total = site.data.coverage.coverage-summary.total %}
12
- <!-- Include the html snippet in `_includes/coverage-summary.html` with the parameters "main" as `branch` and the totals from the data as `total`. -->
13
- {% include coverage-summary.html branch="main" total=total %}
14
- </div>
data/index.markdown DELETED
@@ -1,48 +0,0 @@
1
- ---
2
- layout: default
3
- ---
4
-
5
- <div class="md:grid md:grid-cols-3 md:gap-8 md:items-start md:justify-center">
6
- <div class="md:col-start-1 md:col-span-2">
7
- <div class="">
8
- <h2 class="md:mt-0">Main</h2>
9
-
10
- <h3>Code Coverage</h3>
11
- <!--
12
- Jekyll provides access to YAML, JSON, CSV, and TSV in the `_data` directory using `site.data`. It supports retrieving data nested in directories, files, and objects. https://jekyllrb.com/docs/datafiles/
13
-
14
- Get the data from the `total` field in `_data/coverage/coverage-summary.json` and assign it to a variable called `total`.
15
- -->
16
- {% assign total = site.data.coverage.coverage-summary.total %}
17
- <!--
18
- Jekyll uses includes to create reusable snippets of html code. Data can be passed through to the snippet using parameters. https://jekyllrb.com/docs/includes/
19
-
20
- Include the html snippet in `_includes/coverage-summary.html` with the parameters "main" as `branch` and the totals from the data as `total`.
21
- -->
22
- {% include coverage-summary.html branch="main" total=total %}
23
-
24
- <!-- Playwright dashboard added earlier -->
25
- <h3>Playwright</h3>
26
- <!-- Get the data from `_data/playwright-reports/main.json` and assign it to a variable called `data`. -->
27
- {% assign data = site.data.playwright-reports.main %}
28
- <!-- Jekyll uses Liquid filters to provide helper functions. https://jekyllrb.com/docs/liquid/filters/ -->
29
- <!--
30
- Include the html snippet in `_includes/playwright-summary.html` with the parameters "main" as `branch`,
31
- the data variable as `data`, and "/playwright-reports/main.html" as `url`.
32
- -->
33
- {% include playwright-summary.html branch="main" data=data url="/playwright-reports/main.html" %}
34
- </div>
35
-
36
- <div class="">
37
- <h2>Latest Reports from Branches</h2>
38
- <!-- Include the html snippet from `_includes/playwright-branch-list.html` -->
39
- {% include playwright-branch-list.html %}
40
- </div>
41
- </div>
42
-
43
- <div class="md:mt-[-2rem] md:col-start-3">
44
- {% for post in site.categories["release"] limit: 3 %}
45
- {% include release-note.html post=post content=post.content %}
46
- {% endfor %}
47
- </div>
48
- </div>
@@ -1,12 +0,0 @@
1
- ---
2
- layout: page
3
- # the header for the page
4
- title: "Playwright Reports for Branches"
5
- # the link to page https://jekyllrb.com/docs/permalinks/
6
- permalink: playwright-reports/branches/
7
- ---
8
-
9
- <div>
10
- <!-- Include the html snippet in `_includes/playwright-branch-list.html` -->
11
- {% include playwright-branch-list.html %}
12
- </div>
@@ -1,26 +0,0 @@
1
- ---
2
- layout: page
3
- # the header for the page
4
- title: "Playwright Reports"
5
- # the link to page https://jekyllrb.com/docs/permalinks/
6
- permalink: playwright-reports/
7
- ---
8
-
9
- <div>
10
- <h2>Main
11
- </h2>
12
- <!-- Get the data from `_data/playwright-reports/main.json` and assign it to a variable called `data`. -->
13
- {% assign data = site.data.playwright-reports.main %}
14
- <!--
15
- Include the html snippet in `_includes/playwright-summary.html` with the parameters "main" as `branch`,
16
- the data variable as `data`, and "/playwright-reports/main.html" as `url`.
17
- -->
18
- {% include playwright-summary.html branch="main" data=data url="/playwright-reports/main.html" %}
19
-
20
- <div class="mt-8">
21
- <h2>Latest Reports from Branches
22
- </h2>
23
- <!-- Include the html snippet in `_includes/playwright-branch-list.html` -->
24
- {% include playwright-branch-list.html %}
25
- </div>
26
- </div>
data/releases.markdown DELETED
@@ -1,9 +0,0 @@
1
- ---
2
- layout: page
3
- title: Release Notes
4
- permalink: releases/
5
- ---
6
-
7
- {% for post in site.categories["release"] %}
8
- {% include release-note.html post=post content=post.content %}
9
- {% endfor %}