-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utilize source maps for error improvements #4041
Merged
chrisbreiding
merged 137 commits into
jen/reporter-error-templates-fix
from
issue-3966-source-for-command-failures
Jan 8, 2020
Merged
Changes from 129 commits
Commits
Show all changes
137 commits
Select commit
Hold shift + click to select a range
44be8aa
add source map utility
chrisbreiding 7f15da2
capture and store invocation stack on commands
chrisbreiding b0faac6
Merge branch 'develop' into issue-3966-source-for-command-failures
chrisbreiding 13fd293
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding e4ab7fa
embed source map into spec file in a way that the driver can access it
chrisbreiding 8824834
wip: wire up source maps with driver errors
chrisbreiding f4457b1
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
jennifer-shehane babd608
Add existential checks for stack code, don't get props from undefined
jennifer-shehane 094d318
call it generated instead of artifact
chrisbreiding 09030d8
handle lack of code frame properly
chrisbreiding 812a982
add more language support to code frame
chrisbreiding f46ea7c
dry up adding prism transform
chrisbreiding 18fb4a6
clean up / refactor / update and add tests
chrisbreiding dbdd35a
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 7737939
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 7624d85
get wasm served properly with webpack
chrisbreiding 80434fb
get spec frame stack for command failures
chrisbreiding fcd9ef3
use specWindow.Error instead of calling into spec iframe
chrisbreiding ce65507
capture stack and set code frame for assertion failures
chrisbreiding f47c77b
fix wrong line being highlighted when at top of file
chrisbreiding 299e263
use webpack for driver cypress tests
chrisbreiding af5241c
handle assertion error source mapping
chrisbreiding 7a249b1
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 53f0a76
wip - extract source map in driver
chrisbreiding 6f709ab
wip - get tests passing
chrisbreiding aed6bf4
wip
chrisbreiding 0a4aefe
wip
chrisbreiding 72765f5
refactor, add/update tests
chrisbreiding 038b1ff
remove obselete file
chrisbreiding 0a03755
small fixes
chrisbreiding 93d7b90
fix old reference
chrisbreiding 24da4f7
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 1b71b0d
fix issue with support file not being eval’d
chrisbreiding 7dce76c
add webpack to driver for preprocessor
chrisbreiding d73fb6b
update integration test fixtures
chrisbreiding cfc1bc9
don’t use local paths derp
chrisbreiding a23abe5
fix driver tests
chrisbreiding 2728d40
fix driver tests
chrisbreiding 8acf657
fix driver tests
chrisbreiding ccd8963
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding e9a4ada
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 7d1d94f
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding ac47225
add tests and iron out issues
chrisbreiding 3ac0d01
update integration test fixtures
chrisbreiding bc5529c
fix server integration tests
chrisbreiding c73479c
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding d377f12
fix issue with not passing in invocationStack
chrisbreiding 56e20bd
match whitespace to stack lines and add back ats when details can’t b…
chrisbreiding 6b1bf04
add/improve tests
chrisbreiding 61e741d
fix not passing config through suites
chrisbreiding edb6a1e
linkify stack traces
chrisbreiding 1afbf28
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 74dde92
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding d3f9400
attach invocation stack to errors when it’s more relevant to user
chrisbreiding 0e1986f
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding c456b27
attach parsed stack lines to error
chrisbreiding 2df6179
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 3fa0408
fix lint error
chrisbreiding ec8eb92
fix reporter tests
chrisbreiding d04ae92
fix e2e test
chrisbreiding d9f736e
update snapshots
chrisbreiding 9e37286
refactor/fix issues with error utils
chrisbreiding 9bbea8e
fix unit tests
chrisbreiding 6a9289d
update snapshots
chrisbreiding fb3567e
update another snapshot
chrisbreiding a43f4aa
fix snapshot
chrisbreiding b221a46
attach correct absolute path to stack line
chrisbreiding 5a73476
make codeFrame singular instead of an array
chrisbreiding 061434b
refactor, simplify, and add tests
chrisbreiding fd7be06
fix stack line in reporter
chrisbreiding 3c2f0e1
re-arrange e2e test
chrisbreiding 41ba75c
handle edge case
chrisbreiding abe12f7
fix stack utils spec
chrisbreiding 0d8bf16
remove unused imports
chrisbreiding de40803
fix assumption that errors always originate in support or spec file
chrisbreiding b50c71e
fix source map utils spec
chrisbreiding 914590f
catch file not found in source map errors
chrisbreiding 3b7c9a7
add tooltip to stack and code frame file paths to open on computer or…
chrisbreiding 61169ef
refactor
chrisbreiding 303f1c1
decaffeinate: Rename saved_state.coffee from .coffee to .js
chrisbreiding 720a630
decaffeinate: Convert saved_state.coffee to JS
chrisbreiding 4a97c91
decaffeinate: Run post-processing cleanups on saved_state.coffee
chrisbreiding a8cd916
clean up decaffeinated saved_state.js a bit
chrisbreiding d85aaca
move saved state util into saved state lib
chrisbreiding 654c248
upgrade react and mobx in reporter and runner
chrisbreiding 478ac20
add ui-components package and extract dropdown into it
chrisbreiding abd1ed6
add scripts to ui-components package.json
chrisbreiding 7333554
have ui-components require build
chrisbreiding 19e774b
allow more flexibility with arrow body style in reporter
chrisbreiding dabcb6c
nest ui components in src directory
chrisbreiding c732fa5
set up ui-components package to record
chrisbreiding 97b1ba5
use the right project id
chrisbreiding 36ca2b4
fix scss path
chrisbreiding 977e00f
add eslint react to ui-components cypress tests
chrisbreiding 026348a
fix react deprecations/warnings
chrisbreiding cd5a3dc
switch method of testing ui-components
chrisbreiding f022378
create editor picker component
chrisbreiding bd32134
enable tests to define component to be rendered
andrew-codes eff5f72
RadioGroup set of components- RadioGroup is a set of selectable items…
andrew-codes f9d3367
additional styling tests to showcase common examples
andrew-codes ec848e1
revisit implementationradio is a form of single selection. Much of th…
andrew-codes 4176bfa
use new select component in editor picker
chrisbreiding aa5340b
rename spec
chrisbreiding 15dc266
satisfy typescript
chrisbreiding ee26eb9
fix dropdown test
chrisbreiding b700f74
ignore cypress screenshots and videos
chrisbreiding 119c575
clean up webpack config
chrisbreiding 499ae41
use lodash instead of lodash/fp
chrisbreiding 456ea83
initial implementation of editor picker workflow
chrisbreiding 3c06e0b
refactor select and editor-picker components
chrisbreiding 4575cd8
improve saved_state api
chrisbreiding b04a186
create editors util
chrisbreiding 21351de
wire up ui and server side
chrisbreiding 7e33bf0
fix tests
chrisbreiding 4123784
refactor editor picker modal
chrisbreiding b166bbf
validate editor picker
chrisbreiding 5083cf2
trim other editor path
chrisbreiding 8b2531e
add special handling if no user editors found
chrisbreiding e8230d0
improve editor picker styles
chrisbreiding 5c52dc6
fix modal button flickering issue
chrisbreiding c7c36e3
add global settings with editor picker to desktop-gaui
chrisbreiding be31369
include font-awesome as ui-components dep
chrisbreiding e84688f
change order of desktop-gui scss imports
chrisbreiding 01ebc76
Merge branch 'jen/reporter-error-templates-fix' into issue-3966-sourc…
chrisbreiding 98111cc
temp fix for desktop-gui build issue
chrisbreiding 2948570
fix temp fix
chrisbreiding c02b440
one more
chrisbreiding 3d803b3
oops
chrisbreiding f3ec02c
update snapshots
chrisbreiding 6438085
move getting invocation stack to right place
chrisbreiding eae8f1b
fix class name
chrisbreiding 4762f5e
fix editors types and tests
chrisbreiding ddff5ea
uncomment scss and hope it was just a CI cache issue
chrisbreiding 443f0bf
nevermind :(
chrisbreiding 7a89429
fix isCustom forwarding
chrisbreiding c8e0526
rename select to select-group
chrisbreiding ffee0bc
uncomment scss
chrisbreiding File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import _ from 'lodash' | ||
import { action } from 'mobx' | ||
import { EditorPicker } from '@packages/ui-components' | ||
import { observer, useLocalStore } from 'mobx-react' | ||
import React, { useEffect } from 'react' | ||
|
||
import ipc from '../lib/ipc' | ||
|
||
const openHelp = (e) => { | ||
e.preventDefault() | ||
ipc.externalOpen('https://on.cypress.io/global-settings') | ||
} | ||
|
||
const save = _.debounce((editor) => { | ||
ipc.setUserEditor(editor) | ||
.catch(() => {}) // ignore errors | ||
}, 500) | ||
|
||
const GlobalSettings = observer(() => { | ||
const state = useLocalStore(() => ({ | ||
editors: [], | ||
isLoadingEditor: true, | ||
chosenEditor: {}, | ||
setEditors: action((editors) => { | ||
state.editors = editors | ||
state.isLoadingEditor = false | ||
}), | ||
setChosenEditor: action((editor) => { | ||
state.chosenEditor = editor | ||
save(editor) | ||
}), | ||
setOtherPath: action((otherPath) => { | ||
const otherOption = _.find(state.editors, { isOther: true }) | ||
|
||
otherOption.openerId = otherPath | ||
save(otherOption) | ||
}), | ||
})) | ||
|
||
useEffect(() => { | ||
ipc.getUserEditor().then(({ preferredEditor, availableEditors }) => { | ||
if (preferredEditor) { | ||
state.setChosenEditor(preferredEditor) | ||
} | ||
|
||
state.setEditors(availableEditors) | ||
}) | ||
}, [true]) | ||
|
||
return ( | ||
<div className="global-settings"> | ||
<a href='#' className='learn-more' onClick={openHelp}> | ||
<i className='fas fa-info-circle'></i> Learn more | ||
</a> | ||
|
||
<p className='text-muted'>Global settings take effect for every project on your system. Changing them here will change them for other projects as well.</p> | ||
<h3>Preferred Editor</h3> | ||
<p>Your preferred editor is used to open files from the test runner (e.g. when clicking links in error stack traces)</p> | ||
{state.isLoadingEditor ? | ||
<p className='loading-editors'> | ||
<i className='fas fa-spinner fa-spin'></i> Loading Editors... | ||
</p> : | ||
<EditorPicker | ||
chosen={state.chosenEditor} | ||
editors={state.editors} | ||
onSelect={state.setChosenEditor} | ||
onUpdateOtherPath={state.setOtherPath} | ||
/> | ||
} | ||
</div> | ||
) | ||
}) | ||
|
||
export default GlobalSettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Proxy Settings" is technically a "Global Setting", at some point, we should move the preferred editor + proxy settings to their own "Global Settings" section that is distinct from project-level settings.
So we don't overly inflate the UI changes from this PR, maybe the "Proxy Settings" should just be moved into the new "Global Settings" section for now?