Skip to content

Commit

Permalink
Combined fe and be (pytest-dev#479)
Browse files Browse the repository at this point in the history
* 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 <jim.brannlund@gmail.com>

* 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 <jimbrannlund@fastmail.com>

* 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 <vikt.gust@gmail.com>
  • Loading branch information
3 people committed Apr 3, 2023
1 parent 0b3936a commit bc29afe
Show file tree
Hide file tree
Showing 51 changed files with 9,142 additions and 2,637 deletions.
32 changes: 19 additions & 13 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": "eslint:recommended",
"extends": [
"google"
],
"parserOptions": {
"ecmaVersion": 12
"ecmaVersion": "latest"
},
"rules": {
"array-bracket-spacing": "error",
"block-scoped-var": "error",
"block-spacing": "error",
"brace-style": "error",
"camelcase": "error",
"camelcase": "off",
"class-methods-use-this": "error",
"consistent-return": "error",
"default-case": "error",
"default-case-last": "error",
"default-param-last": "error",
"grouped-accessor-pairs": "error",
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"unix"
],
"indent": [ "error", 4 ],
"linebreak-style": [ "error", "unix" ],
"max-len": ["error", { "code": 120 }],
"no-caller": "error",
"no-console": "error",
"no-empty-function": "error",
Expand All @@ -43,17 +41,25 @@
"no-throw-literal": "error",
"no-undefined": "error",
"no-unreachable-loop": "error",
"no-unused-expressions": "error",
"no-unused-expressions": "off",
"no-useless-backreference": "error",
"no-useless-concat": "error",
"no-var": "error",
"object-curly-spacing": [
"error",
"always",
{
"arraysInObjects": true
}
],
"prefer-const": "error",
"prefer-promise-reject-errors": "error",
"require-atomic-updates": "error",
"require-await": "error",
"require-jsdoc" : 0,
"semi": [
"error",
"always"
"never"
],
"quotes": [
"error",
Expand Down
36 changes: 24 additions & 12 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,36 @@ jobs:
name: Build Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'
- name: Install tox
run: python -m pip install --upgrade tox
- name: Build docs with tox
run: python -m tox -e docs
run: tox -e docs

tests:
uses: pytest-dev/pytest-html/.github/workflows/tests.yml@master

publish:
if: github.repository_owner == 'pytest-dev'
name: Publish to PyPI registry
needs:
- tests
runs-on: ubuntu-latest
env:
PY_COLORS: 1
TOXENV: packaging

steps:
- uses: actions/setup-python@v3
- name: Switch to using Python 3.10 by default
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.10'

- name: Install tox
run: python -m pip install --user tox

- name: Check out src from Git
uses: actions/checkout@v3
with:
Expand All @@ -62,6 +64,7 @@ jobs:
) &&
1 || 0
}}
- name: Drop Git tags from HEAD for non-tag-create events
if: >-
github.event_name != 'create' ||
Expand All @@ -70,8 +73,16 @@ jobs:
git tag --points-at HEAD
|
xargs git tag --delete
- name: Build dists
run: python -m tox
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v1

- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Publish to test.pypi.org
if: >-
(
Expand All @@ -84,14 +95,15 @@ jobs:
github.event_name == 'create' &&
github.event.ref_type == 'tag'
)
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.testpypi_password }}
repository_url: https://test.pypi.org/legacy/

- name: Publish to pypi.org
if: >- # "create" workflows run separately from "push" & "pull_request"
github.event_name == 'create' &&
github.event.ref_type == 'tag'
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
175 changes: 96 additions & 79 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,115 +5,132 @@ on:

jobs:
test_python:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
name: ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: ubuntu-latest
name: py36-ubuntu
python-version: 3.6

- os: windows-latest
name: py36-windows
python-version: 3.6

- os: macOS-latest
name: py36-mac
python-version: 3.6
- tox-env: "py37"
python-version: "3.7"

- os: ubuntu-latest
name: py37-ubuntu
python-version: 3.7
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: windows-latest
# name: py37-windows
# python-version: 3.7

- os: windows-latest
name: py37-windows
python-version: 3.7
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: macOS-latest
# name: py37-mac
# python-version: 3.7

- os: macOS-latest
name: py37-mac
python-version: 3.7
- tox-env: "py38"
python-version: "3.8"

- os: ubuntu-latest
name: py38-ubuntu
python-version: 3.8
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: windows-latest
# name: py38-windows
# python-version: 3.8

- os: windows-latest
name: py38-windows
python-version: 3.8
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: macOS-latest
# name: py38-mac
# python-version: 3.8

- os: macOS-latest
name: py38-mac
python-version: 3.8
- tox-env: "py39"
python-version: "3.9"

- os: ubuntu-latest
name: py39-ubuntu
python-version: 3.9
- tox-env: "py310"
python-version: "3.10"

- os: windows-latest
name: py39-windows
python-version: 3.9
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: windows-latest
# name: py39-windows
# python-version: 3.9

- os: macOS-latest
name: py39-mac
python-version: 3.9
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: macOS-latest
# name: py39-mac
# python-version: 3.9

- os: ubuntu-latest
name: pypy3-ubuntu
python-version: pypy3
- tox-env: "pypy3"
python-version: "pypy3.9"
skip-coverage: true

- os: windows-latest
name: pypy3-windows
python-version: pypy3
# https://github.com/pytest-dev/pytest-html/issues/585
# - os: windows-latest
# name: pypy3-windows
# python-version: pypy3

# https://github.com/pytest-dev/pytest-html/issues/482
# - os: macOS-latest
# name: pypy3-mac
# python-version: pypy3
# python-version: pypy-3.8

- os: ubuntu-latest
name: devel-ubuntu
python-version: 3.9
- tox-env: "devel"
python-version: "3.11-dev"

steps:
- name: Set Newline Behavior
run : git config --global core.autocrlf false
- uses: actions/checkout@master
run: git config --global core.autocrlf false

- uses: actions/checkout@v3

- name: Start chrome
run: ./start

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'

- name: Install Dependencies
run: npm ci

- name: Build app
run: npm run build:ci

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix['python-version'] }}
python-version: ${{ matrix.python-version }}

- name: Install tox
run: python -m pip install --upgrade tox
- name: Get Tox Environment Name From Matrix Name
uses: rishabhgupta/split-by@v1
id: split-matrix-name

- name: Test with coverage
if: ${{ ! matrix.skip-coverage }}
run: tox -e ${{ matrix.tox-env }}-cov

- name: Test without coverage
if: ${{ matrix.skip-coverage }}
run: tox -e ${{ matrix.tox-env }}

# TODO: https://github.com/pytest-dev/pytest-html/issues/481
- name: Upload coverage to codecov
if: >-
${{
! github.event.schedule &&
! matrix.skip-coverage &&
github.repository_owner == 'pytest-dev'
}}
uses: codecov/codecov-action@v3
with:
string: '${{ matrix.name }}'
split-by: '-'
- name: Test with tox
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov
# TODO: https://github.com/pytest-dev/pytest-html/issues/481
# - name: Upload coverage to codecov
# if: github.event.schedule == ''
# uses: codecov/codecov-action@v2
# with:
# fail_ci_if_error: true
# file: ./coverage.xml
# flags: tests
# name: ${{ matrix.py }} - ${{ matrix.os }}
# verbose: true
fail_ci_if_error: true
files: ./coverage.xml
flags: tests
name: ${{ matrix.tox-env }}
verbose: true

test_javascript:
name: grunt
name: mocha
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '12.x'
node-version: '16.x'
- name: Install Dependencies
run: npm install
- name: QUnit Tests
run: npm test
run: npm ci
- name: Mocha Tests
run: npm run unit
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ local.properties
# JS files/folders
## node / npm
node_modules/
package-lock.json

# MacOS files
.DS_Store
Expand All @@ -51,3 +50,6 @@ Pipfile.lock

# sphinx/read the docs
docs/_build/

*.html
assets/

0 comments on commit bc29afe

Please sign in to comment.