Skip to content

Commit 0408b0d

Browse files
BeyondEvilpre-commit-ci[bot]drRedflint
authored
Combined fe and be (#479)
* fix main.js conflicts * fix js test * fix resource (main.js) test * revert change to report extra * filters style * css and dom brush up * Buildable app * always store data in html * Always store data blob in file * json dump test data * read data from dom element * manually initialize state * minimalistic dataset * simplify included files * Handle report extras * Handle python report hooks * imgviewer * present name in image viewer and open img on click * setup linter for project * conform to styles * show video in imageviewer (#14) * show video in imageviewer * Chore: Pluralize extra (#15) * Add extras.HTML * Move outcome handling to backend (#18) * Move outcome handling to backend * Pass in text version of longrepr if present * make collapse/expand all functional (#20) * make collapse/expand all functional * only create links for text, url and json (#22) * make filter search case insensitive (#21) * make filter search case insensitive * use sessionStorage to prevent preferences to be reapplied on new reports * avoid multiple event bindings + fix filter bug * Collapse individual row Co-authored-by: Jim Brännlund <[email protected]> * add no log output captured string * Query params (#25) * Add query params * adjust tests (#26) * Duration format (#27) * adjust tests * build format handler * remove dependency --------- Co-authored-by: Jim Brännlund <[email protected]> * Beyondevil/cleanup (#28) * chore: Cleanup branch before merge * chore: Fix duration and CI * Fix pre-commit issues --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Viktor Gustafsson <[email protected]>
1 parent aa85f41 commit 0408b0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+9139
-2644
lines changed

.eslintrc.json

+19-13
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
{
22
"env": {
33
"browser": true,
4+
"commonjs": true,
45
"es2021": true
56
},
6-
"extends": "eslint:recommended",
7+
"extends": [
8+
"google"
9+
],
710
"parserOptions": {
8-
"ecmaVersion": 12
11+
"ecmaVersion": "latest"
912
},
1013
"rules": {
1114
"array-bracket-spacing": "error",
1215
"block-scoped-var": "error",
1316
"block-spacing": "error",
1417
"brace-style": "error",
15-
"camelcase": "error",
18+
"camelcase": "off",
1619
"class-methods-use-this": "error",
1720
"consistent-return": "error",
1821
"default-case": "error",
1922
"default-case-last": "error",
2023
"default-param-last": "error",
2124
"grouped-accessor-pairs": "error",
22-
"indent": [
23-
"error",
24-
4
25-
],
26-
"linebreak-style": [
27-
"error",
28-
"unix"
29-
],
25+
"indent": [ "error", 4 ],
26+
"linebreak-style": [ "error", "unix" ],
27+
"max-len": ["error", { "code": 120 }],
3028
"no-caller": "error",
3129
"no-console": "error",
3230
"no-empty-function": "error",
@@ -43,17 +41,25 @@
4341
"no-throw-literal": "error",
4442
"no-undefined": "error",
4543
"no-unreachable-loop": "error",
46-
"no-unused-expressions": "error",
44+
"no-unused-expressions": "off",
4745
"no-useless-backreference": "error",
4846
"no-useless-concat": "error",
4947
"no-var": "error",
48+
"object-curly-spacing": [
49+
"error",
50+
"always",
51+
{
52+
"arraysInObjects": true
53+
}
54+
],
5055
"prefer-const": "error",
5156
"prefer-promise-reject-errors": "error",
5257
"require-atomic-updates": "error",
5358
"require-await": "error",
59+
"require-jsdoc" : 0,
5460
"semi": [
5561
"error",
56-
"always"
62+
"never"
5763
],
5864
"quotes": [
5965
"error",

.github/workflows/actions.yml

+24-12
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,36 @@ jobs:
1818
name: Build Docs
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@master
21+
- uses: actions/checkout@v3
2222
- name: Set up Python
23-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
2424
with:
25-
python-version: 3.9
25+
python-version: '3.10'
2626
- name: Install tox
2727
run: python -m pip install --upgrade tox
2828
- name: Build docs with tox
29-
run: python -m tox -e docs
29+
run: tox -e docs
3030

3131
tests:
3232
uses: ./.github/workflows/tests.yml
3333

3434
publish:
35+
if: github.repository_owner == 'pytest-dev'
3536
name: Publish to PyPI registry
3637
needs:
3738
- tests
3839
runs-on: ubuntu-latest
3940
env:
4041
PY_COLORS: 1
41-
TOXENV: packaging
42-
4342
steps:
44-
- uses: actions/setup-python@v3
43+
- name: Switch to using Python 3.10 by default
44+
uses: actions/setup-python@v4
4545
with:
46-
python-version: 3.9
46+
python-version: '3.10'
47+
4748
- name: Install tox
4849
run: python -m pip install --user tox
50+
4951
- name: Check out src from Git
5052
uses: actions/checkout@v3
5153
with:
@@ -62,6 +64,7 @@ jobs:
6264
) &&
6365
1 || 0
6466
}}
67+
6568
- name: Drop Git tags from HEAD for non-tag-create events
6669
if: >-
6770
github.event_name != 'create' ||
@@ -70,8 +73,16 @@ jobs:
7073
git tag --points-at HEAD
7174
|
7275
xargs git tag --delete
73-
- name: Build dists
74-
run: python -m tox
76+
77+
- name: Build and Check Package
78+
uses: hynek/build-and-inspect-python-package@v1
79+
80+
- name: Download Package
81+
uses: actions/download-artifact@v3
82+
with:
83+
name: Packages
84+
path: dist
85+
7586
- name: Publish to test.pypi.org
7687
if: >-
7788
(
@@ -84,14 +95,15 @@ jobs:
8495
github.event_name == 'create' &&
8596
github.event.ref_type == 'tag'
8697
)
87-
uses: pypa/gh-action-pypi-publish@master
98+
uses: pypa/gh-action-pypi-publish@release/v1
8899
with:
89100
password: ${{ secrets.testpypi_password }}
90101
repository_url: https://test.pypi.org/legacy/
102+
91103
- name: Publish to pypi.org
92104
if: >- # "create" workflows run separately from "push" & "pull_request"
93105
github.event_name == 'create' &&
94106
github.event.ref_type == 'tag'
95-
uses: pypa/gh-action-pypi-publish@master
107+
uses: pypa/gh-action-pypi-publish@release/v1
96108
with:
97109
password: ${{ secrets.pypi_password }}

.github/workflows/tests.yml

+93-83
Original file line numberDiff line numberDiff line change
@@ -5,123 +5,133 @@ on:
55

66
jobs:
77
test_python:
8-
name: ${{ matrix.name }}
9-
runs-on: ${{ matrix.os }}
8+
name: ${{ matrix.python-version }}
9+
runs-on: ubuntu-latest
1010
strategy:
1111
fail-fast: false
1212
matrix:
1313
include:
14-
- os: ubuntu-latest
15-
name: py37-ubuntu
16-
python-version: 3.7
17-
18-
- os: windows-latest
19-
name: py37-windows
20-
python-version: 3.7
14+
- tox-env: "py37"
15+
python-version: "3.7"
2116

22-
- os: macOS-latest
23-
name: py37-mac
24-
python-version: 3.7
17+
# https://github.com/pytest-dev/pytest-html/issues/585
18+
# - os: windows-latest
19+
# name: py37-windows
20+
# python-version: 3.7
2521

26-
- os: ubuntu-latest
27-
name: py38-ubuntu
28-
python-version: 3.8
22+
# https://github.com/pytest-dev/pytest-html/issues/585
23+
# - os: macOS-latest
24+
# name: py37-mac
25+
# python-version: 3.7
2926

30-
- os: windows-latest
31-
name: py38-windows
32-
python-version: 3.8
27+
- tox-env: "py38"
28+
python-version: "3.8"
3329

34-
- os: macOS-latest
35-
name: py38-mac
36-
python-version: 3.8
30+
# https://github.com/pytest-dev/pytest-html/issues/585
31+
# - os: windows-latest
32+
# name: py38-windows
33+
# python-version: 3.8
3734

38-
- os: ubuntu-latest
39-
name: py39-ubuntu
40-
python-version: 3.9
35+
# https://github.com/pytest-dev/pytest-html/issues/585
36+
# - os: macOS-latest
37+
# name: py38-mac
38+
# python-version: 3.8
4139

42-
- os: windows-latest
43-
name: py39-windows
44-
python-version: 3.9
40+
- tox-env: "py39"
41+
python-version: "3.9"
4542

46-
- os: macOS-latest
47-
name: py39-mac
48-
python-version: 3.9
43+
- tox-env: "py310"
44+
python-version: "3.10"
4945

50-
- os: ubuntu-latest
51-
name: py310-ubuntu
52-
python-version: '3.10'
46+
# https://github.com/pytest-dev/pytest-html/issues/585
47+
# - os: windows-latest
48+
# name: py39-windows
49+
# python-version: 3.9
5350

54-
- os: windows-latest
55-
name: py310-windows
56-
python-version: '3.10'
51+
# https://github.com/pytest-dev/pytest-html/issues/585
52+
# - os: macOS-latest
53+
# name: py39-mac
54+
# python-version: 3.9
5755

58-
- os: macOS-latest
59-
name: py310-mac
60-
python-version: '3.10'
56+
- tox-env: "pypy3"
57+
python-version: "pypy3.9"
58+
skip-coverage: true
6159

62-
- os: ubuntu-latest
63-
name: pypy3-ubuntu
64-
python-version: pypy-3.8
65-
66-
- os: windows-latest
67-
name: pypy3-windows
68-
python-version: pypy-3.8
60+
# https://github.com/pytest-dev/pytest-html/issues/585
61+
# - os: windows-latest
62+
# name: pypy3-windows
63+
# python-version: pypy3
6964

7065
# https://github.com/pytest-dev/pytest-html/issues/482
71-
- os: macOS-latest
72-
name: pypy3-mac
73-
python-version: pypy-3.8
66+
# - os: macOS-latest
67+
# name: pypy3-mac
68+
# python-version: pypy-3.8
7469

75-
- os: ubuntu-latest
76-
name: devel-ubuntu
77-
python-version: 3.9
70+
- tox-env: "devel"
71+
python-version: "3.11-dev"
7872

7973
steps:
8074
- name: Set Newline Behavior
81-
run : git config --global core.autocrlf false
75+
run: git config --global core.autocrlf false
76+
8277
- uses: actions/checkout@v3
78+
79+
- name: Start chrome
80+
run: ./start
81+
82+
- name: Use Node.js
83+
uses: actions/setup-node@v3
8384
with:
84-
fetch-depth: 0
85+
node-version: '16.x'
86+
87+
- name: Install Dependencies
88+
run: npm ci
89+
90+
- name: Build app
91+
run: npm run build:ci
92+
8593
- name: Set up Python
86-
uses: actions/setup-python@v3
94+
uses: actions/setup-python@v4
8795
with:
88-
python-version: ${{ matrix['python-version'] }}
96+
python-version: ${{ matrix.python-version }}
97+
8998
- name: Install tox
9099
run: python -m pip install --upgrade tox
91-
- name: Get Tox Environment Name From Matrix Name
92-
uses: rishabhgupta/split-by@v1
93-
id: split-matrix-name
94-
with:
95-
string: '${{ matrix.name }}'
96-
split-by: '-'
100+
97101
- name: Test with coverage
98-
if: "! contains(matrix.name, 'pypy3')"
99-
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
102+
if: ${{ ! matrix.skip-coverage }}
103+
run: tox -e ${{ matrix.tox-env }}-cov
104+
100105
- name: Test without coverage
101-
if: "contains(matrix.name, 'pypy3')"
102-
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}
103-
104-
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
105-
# - name: Upload coverage to codecov
106-
# if: github.event.schedule == ''
107-
# uses: codecov/codecov-action@v2
108-
# with:
109-
# fail_ci_if_error: true
110-
# file: ./coverage.xml
111-
# flags: tests
112-
# name: ${{ matrix.py }} - ${{ matrix.os }}
113-
# verbose: true
106+
if: ${{ matrix.skip-coverage }}
107+
run: tox -e ${{ matrix.tox-env }}
108+
109+
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
110+
- name: Upload coverage to codecov
111+
if: >-
112+
${{
113+
! github.event.schedule &&
114+
! matrix.skip-coverage &&
115+
github.repository_owner == 'pytest-dev'
116+
}}
117+
uses: codecov/codecov-action@v3
118+
with:
119+
fail_ci_if_error: true
120+
files: ./coverage.xml
121+
flags: tests
122+
name: ${{ matrix.tox-env }}
123+
verbose: true
114124

115125
test_javascript:
116-
name: grunt
126+
name: mocha
117127
runs-on: ubuntu-latest
118128
steps:
119129
- uses: actions/checkout@v3
120-
- name: Use Node.js ${{ matrix.node-version }}
130+
- name: Use Node.js
121131
uses: actions/setup-node@v3
122132
with:
123-
node-version: '12.x'
133+
node-version: '16.x'
124134
- name: Install Dependencies
125-
run: npm install
126-
- name: QUnit Tests
127-
run: npm test
135+
run: npm ci
136+
- name: Mocha Tests
137+
run: npm run unit

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ local.properties
3535
# JS files/folders
3636
## node / npm
3737
node_modules/
38-
package-lock.json
3938

4039
# MacOS files
4140
.DS_Store
@@ -51,3 +50,6 @@ Pipfile.lock
5150

5251
# sphinx/read the docs
5352
docs/_build/
53+
54+
*.html
55+
assets/

0 commit comments

Comments
 (0)