Skip to content

Move outcome handling to backend#18

Merged
BeyondEvil merged 2 commits intocombined-fe-and-befrom
jim/handle-outcome-in-be
Aug 9, 2022
Merged

Move outcome handling to backend#18
BeyondEvil merged 2 commits intocombined-fe-and-befrom
jim/handle-outcome-in-be

Conversation

@BeyondEvil
Copy link
Copy Markdown
Owner

No description provided.

@BeyondEvil BeyondEvil force-pushed the jim/handle-outcome-in-be branch from aa3759b to 35e2edb Compare August 8, 2022 15:40
const numberOfTests = renderSet.filter(({outcome}) =>
["Passed", "Failed", "XPassed", "XFailed"].includes(outcome)
).length
if (runningState === "Finished") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about creating a isDone fn in datamanager?
That way we wont have a need for comparing strings here.

const allTests = manager.allTests
const collectedItems = manager.collectedItems
const runningState = manager.runningState

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be written cleaner using a destruct:
const { filteredTests, allTests, collectedItems, runningState } = manager


const renderContent = (tests) => {
const renderSet = tests.filter(({ when }) => when === 'call')
const renderSet = tests.filter(({ when, outcome }) => when === 'call' || outcome === "Error" )
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope for this pr, but I would like to create constants for outcome and when, so we do this:
outcome === ERROR instead of outcome === 'Error'

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I like that!

Copy link
Copy Markdown

@drRedflint drRedflint left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Some minor comments, but those could easily be dealt with in another PR to maintain scope.

@BeyondEvil BeyondEvil merged commit 0f6f422 into combined-fe-and-be Aug 9, 2022
@BeyondEvil BeyondEvil deleted the jim/handle-outcome-in-be branch August 9, 2022 20:33
BeyondEvil added a commit that referenced this pull request Mar 5, 2023
* 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>
BeyondEvil added a commit that referenced this pull request Apr 3, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants