From 5e8604d137469a5ed3df97efb685f505e75e9a18 Mon Sep 17 00:00:00 2001 From: Tiffany Forkner Date: Thu, 27 Mar 2025 10:27:39 -0400 Subject: [PATCH 1/2] removing some filters --- Gemfile.lock | 16 ++++++------ _config.yml | 14 ++++++++++- _data/coverage/thresholds.yml | 11 -------- _includes/coverage-summary.html | 11 +++++++- _includes/playwright-summary.html | 34 ++++++++++++++++++------- _plugins/coverage-results-filter.rb | 15 ----------- _plugins/icon-filter.rb | 22 ---------------- _plugins/playwright-results-filter.rb | 36 --------------------------- assets/css/styles.css | 16 +++--------- 9 files changed, 61 insertions(+), 114 deletions(-) delete mode 100644 _data/coverage/thresholds.yml delete mode 100644 _plugins/coverage-results-filter.rb delete mode 100644 _plugins/icon-filter.rb delete mode 100644 _plugins/playwright-results-filter.rb diff --git a/Gemfile.lock b/Gemfile.lock index 60390a3..1868fc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,22 +24,22 @@ GEM ffi (1.17.1-x86_64-linux-gnu) ffi (1.17.1-x86_64-linux-musl) forwardable-extended (2.6.0) - google-protobuf (4.30.1) + google-protobuf (4.30.2) bigdecimal rake (>= 13) - google-protobuf (4.30.1-aarch64-linux) + google-protobuf (4.30.2-aarch64-linux) bigdecimal rake (>= 13) - google-protobuf (4.30.1-arm64-darwin) + google-protobuf (4.30.2-arm64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.30.1-x86-linux) + google-protobuf (4.30.2-x86-linux) bigdecimal rake (>= 13) - google-protobuf (4.30.1-x86_64-darwin) + google-protobuf (4.30.2-x86_64-darwin) bigdecimal rake (>= 13) - google-protobuf (4.30.1-x86_64-linux) + google-protobuf (4.30.2-x86_64-linux) bigdecimal rake (>= 13) http_parser.rb (0.8.0) @@ -64,7 +64,9 @@ GEM safe_yaml (~> 1.0) terminal-table (>= 1.8, < 4.0) webrick (~> 1.7) - jekyll-report-dashboard (0.1.0) + jekyll-report-dashboard (0.1.2) + jekyll (~> 4.4.1) + jekyll-tailwindcss jekyll-sass-converter (3.1.0) sass-embedded (~> 1.75) jekyll-tailwindcss (0.6.2) diff --git a/_config.yml b/_config.yml index ff1845c..106cd41 100644 --- a/_config.yml +++ b/_config.yml @@ -29,9 +29,21 @@ github_username: thetif github_url: "https://github.com/FearlessSolutions/publish-playwright" # Build settings -# theme: +theme: jekyll-report-dashboard # plugins: +coverage: + pass: + lines: 90 + functions: 85 + statements: 90 + branches: 80 + fail: + lines: 70 + functions: 65 + statements: 70 + branches: 60 + # Exclude from processing. # The following items will not be processed, by default. # Any item listed under the `exclude:` key here will be automatically added to diff --git a/_data/coverage/thresholds.yml b/_data/coverage/thresholds.yml deleted file mode 100644 index c9b40c1..0000000 --- a/_data/coverage/thresholds.yml +++ /dev/null @@ -1,11 +0,0 @@ -pass: - lines: 90 - functions: 85 - statements: 90 - branches: 80 - -fail: - lines: 70 - functions: 65 - statements: 70 - branches: 60 diff --git a/_includes/coverage-summary.html b/_includes/coverage-summary.html index efa3d3c..fc527d8 100644 --- a/_includes/coverage-summary.html +++ b/_includes/coverage-summary.html @@ -14,8 +14,17 @@ {{ name | capitalize }} + {% capture status %} + {% if values.pct >= site.coverage.pass.[name] %} + text-pass + {% elsif values.pct > site.coverage.fail.[name] %} + text-warn + {% else %} + text-fail + {% endif %} + {% endcapture %} -
+
{{ values.pct | round: 1 }}%
diff --git a/_includes/playwright-summary.html b/_includes/playwright-summary.html index 3c82183..fce3075 100644 --- a/_includes/playwright-summary.html +++ b/_includes/playwright-summary.html @@ -1,6 +1,7 @@ {% if include.data %} + {% assign results = include.data %} + {% assign total = results.stats.expected + results.stats.unexpected + results.stats.skipped + results.stats.flaky %} - {% assign results = include.data | normalize_playwright %}
@@ -14,13 +15,28 @@ {% endif %} - Run At: {{ results.startTime | date: "%Y-%m-%d %H:%M %Z" }} + Run At: {{ results.stats.startTime | date: "%Y-%m-%d %H:%M %Z" }}
- {{ results.status | status_icon }} + {% capture status_icon %} + {% if results.stats.unexpected > 0 %} + + {% else %} + + {% endif %} + {% endcapture %} + {{ status_icon }}
- {% if results.status == "warn" %} + {% if status == "warn" %}
{% for error in results.errors %} @@ -31,11 +47,11 @@ {% else %}
- {% include playwright-stat.html label="All" value=results.total %} - {% include playwright-stat.html label="Passed" value=results.expected %} - {% include playwright-stat.html label="Failed" value=results.unexpected %} - {% include playwright-stat.html label="Flaky" value=results.flaky %} - {% include playwright-stat.html label="Skipped" value=results.skipped %} + {% include playwright-stat.html label="All" value=total %} + {% include playwright-stat.html label="Passed" value=results.stats.expected %} + {% include playwright-stat.html label="Failed" value=results.stats.unexpected %} + {% include playwright-stat.html label="Flaky" value=results.stats.flaky %} + {% include playwright-stat.html label="Skipped" value=results.stats.skipped %}
{% endif %} diff --git a/_plugins/coverage-results-filter.rb b/_plugins/coverage-results-filter.rb deleted file mode 100644 index 49e02f8..0000000 --- a/_plugins/coverage-results-filter.rb +++ /dev/null @@ -1,15 +0,0 @@ -module Jekyll - module CoverageResultFilter - def coverage_status(input, name) - if input >= @context.registers[:site].data["coverage"]["thresholds"]["pass"][name] - "pass" - elsif input >= @context.registers[:site].data["coverage"]["thresholds"]["fail"][name] - "warn" - else - "fail" - end - end - end -end - -Liquid::Template.register_filter(Jekyll::CoverageResultFilter) diff --git a/_plugins/icon-filter.rb b/_plugins/icon-filter.rb deleted file mode 100644 index 7b8dd51..0000000 --- a/_plugins/icon-filter.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Jekyll - module IconFilter - def status_icon(input) - case input - when "pass" - "" - when "fail" - "" - when "warn" - "" - end - end - end -end - -Liquid::Template.register_filter(Jekyll::IconFilter) diff --git a/_plugins/playwright-results-filter.rb b/_plugins/playwright-results-filter.rb deleted file mode 100644 index 87bd36b..0000000 --- a/_plugins/playwright-results-filter.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Jekyll - module PlaywrightResultFilter - def normalize_playwright(input) - status = playwright_status(input) - total = playwright_total(input) - stats = input["stats"] - stats["errors"] = input["errors"] - stats["total"] = total - stats["status"] = status - stats - end - - def playwright_total(input) - if input["errors"].size > 0 - 0 - else - input["stats"]["expected"] + input["stats"]["unexpected"] + input["stats"]["skipped"] + input["stats"]["flaky"] - end - end - - def playwright_status(input) - if input["stats"]["unexpected"] > 0 - # if the unexpected results is greater than one, return fail - "fail" - elsif input["errors"].size == 0 - # if there are no unexpected results and no errors, return pass - "pass" - else - # otherwise if there are errors, return error - "warn" - end - end - end -end - -Liquid::Template.register_filter(Jekyll::PlaywrightResultFilter) diff --git a/assets/css/styles.css b/assets/css/styles.css index 4e8957a..f3b42b9 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -16,6 +16,10 @@ --color-highlight: var(--color-gray-100); --color-outline: var(--color-gray-300); + --color-pass: var(--color-green-700); + --color-fail: var(--color-red-600); + --color-warn: var(--color-amber-400); + --breakpoint-sm: 40rem; /* 640px */ --breakpoint-md: 48rem; /* 768px */ --breakpoint-lg: 64rem; /* 1024px */ @@ -214,18 +218,6 @@ } } - .pass { - color: var(--color-green-700); - } - - .fail { - color: var(--color-red-600); - } - - .warn { - color: var(--color-amber-400); - } - .gh-markdown-content { width: 100%; overflow-x: auto; From 44ab9b6736458a6685249fb0f8fd76cfe809ac46 Mon Sep 17 00:00:00 2001 From: Tiffany Forkner Date: Thu, 27 Mar 2025 12:09:12 -0400 Subject: [PATCH 2/2] updated with new theme updates --- Gemfile | 3 --- Gemfile.lock | 3 +-- _includes/coverage-summary.html | 12 ++++++------ _includes/playwright-branch-list.html | 9 +++++++-- _includes/playwright-summary.html | 5 ++--- _layouts/page.html | 1 + _layouts/playwright-branch.html | 9 +++++++-- _layouts/post.html | 1 + _plugins/key-list-filter.rb | 14 -------------- _plugins/playwright-branch-index-generator.rb | 10 +++++++--- playwright-branches.markdown | 1 + 11 files changed, 33 insertions(+), 35 deletions(-) delete mode 100644 _plugins/key-list-filter.rb diff --git a/Gemfile b/Gemfile index 5f33a06..dde583b 100644 --- a/Gemfile +++ b/Gemfile @@ -4,9 +4,6 @@ gem "jekyll", "~> 4.4.1" gem "jekyll-report-dashboard" -group :jekyll_plugins do - gem "jekyll-tailwindcss" -end # Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem # and associated library. diff --git a/Gemfile.lock b/Gemfile.lock index 1868fc5..12cf845 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,7 +64,7 @@ GEM safe_yaml (~> 1.0) terminal-table (>= 1.8, < 4.0) webrick (~> 1.7) - jekyll-report-dashboard (0.1.2) + jekyll-report-dashboard (0.1.7) jekyll (~> 4.4.1) jekyll-tailwindcss jekyll-sass-converter (3.1.0) @@ -164,7 +164,6 @@ DEPENDENCIES http_parser.rb (~> 0.6.0) jekyll (~> 4.4.1) jekyll-report-dashboard - jekyll-tailwindcss tzinfo (>= 1, < 3) tzinfo-data wdm (~> 0.1) diff --git a/_includes/coverage-summary.html b/_includes/coverage-summary.html index fc527d8..dad20f1 100644 --- a/_includes/coverage-summary.html +++ b/_includes/coverage-summary.html @@ -14,15 +14,15 @@ {{ name | capitalize }}
- {% capture status %} - {% if values.pct >= site.coverage.pass.[name] %} + {%- capture status -%} + {%- if values.pct >= site.coverage.pass.[name] -%} text-pass - {% elsif values.pct > site.coverage.fail.[name] %} + {%- elsif values.pct > site.coverage.fail.[name] -%} text-warn - {% else %} + {%- else -%} text-fail - {% endif %} - {% endcapture %} + {%- endif -%} + {%- endcapture -%}
diff --git a/_includes/playwright-branch-list.html b/_includes/playwright-branch-list.html index e4c945d..3e7b70e 100644 --- a/_includes/playwright-branch-list.html +++ b/_includes/playwright-branch-list.html @@ -11,8 +11,13 @@

{{ branch_name }}

View Previous Runs
- - {% assign latest_run_id = site.data.playwright-reports.branches[branch_name] | key_list | reverse | first %} + + {% assign runs = "" | split: ',' %} + {% for run_id in site.data.playwright-reports.branches[branch_name] %} + {% assign runs = runs | push: run_id %} + {% endfor %} + + {% assign latest_run_id = runs | reverse | first %} {% assign data = site.data.playwright-reports.branches[branch_name][latest_run_id] %} {% capture report_link %}/playwright-reports/branches/{{branch_name}}/{{latest_run_id}}.html{% endcapture %} diff --git a/_includes/playwright-summary.html b/_includes/playwright-summary.html index fce3075..e26ca7b 100644 --- a/_includes/playwright-summary.html +++ b/_includes/playwright-summary.html @@ -1,8 +1,7 @@ {% if include.data %} + {% assign results = include.data %} {% assign total = results.stats.expected + results.stats.unexpected + results.stats.skipped + results.stats.flaky %} - -
@@ -18,7 +17,7 @@ Run At: {{ results.stats.startTime | date: "%Y-%m-%d %H:%M %Z" }}
- + {% capture status_icon %} {% if results.stats.unexpected > 0 %}