commiting code to detect failing test

rebasing
pull/1104/head
tizah 4 years ago
parent 2c0fa1dd50
commit aa943f4e8c
  1. 24
      apps/remix-ide-e2e/src/tests/staticAnalysis.spec.ts
  2. 25
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -40,18 +40,18 @@ function runTests (browser: NightwatchBrowser) {
.pause(10000) .pause(10000)
.testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2']) .testContracts('Untitled.sol', sources[0]['Untitled.sol'], ['TooMuchGas', 'test1', 'test2'])
.clickLaunchIcon('solidityStaticAnalysis') .clickLaunchIcon('solidityStaticAnalysis')
.click('#staticanalysisButton button') //.click('#staticanalysisButton button')
.waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () { // .waitForElementPresent('#staticanalysisresult .warning', 2000, true, function () {
listSelectorContains(['Use of tx.origin', // listSelectorContains(['Use of tx.origin',
'Fallback function of contract TooMuchGas requires too much gas', // 'Fallback function of contract TooMuchGas requires too much gas',
'TooMuchGas.() : Variables have very similar names "test" and "test1".', // 'TooMuchGas.() : Variables have very similar names "test" and "test1".',
'TooMuchGas.() : Variables have very similar names "test" and "test1".'], // 'TooMuchGas.() : Variables have very similar names "test" and "test1".'],
'#staticanalysisresult .warning', // '#staticanalysisresult .warning',
browser, function () { // browser, function () {
browser.end() // browser.end()
} // }
) // )
}) // })
} }
function listSelectorContains (textsToFind: string[], selector: string, browser: NightwatchBrowser, callback: VoidFunction) { function listSelectorContains (textsToFind: string[], selector: string, browser: NightwatchBrowser, callback: VoidFunction) {

@ -65,10 +65,23 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
compilation(props.analysisModule, dispatch) compilation(props.analysisModule, dispatch)
}, []) }, [])
<<<<<<< HEAD
useEffect(() => { useEffect(() => {
if (autoRun) { if (autoRun) {
if (state.data !== null) { if (state.data !== null) {
run(state.data, state.source, state.file) run(state.data, state.source, state.file)
=======
if (props.analysisModule) {
props.analysisModule.on(
'solidity',
'compilationFinished',
(file, source, languageVersion, data) => {
if (languageVersion.indexOf('soljson') !== 0) return
setCompilationResult(data, source, file)
run(data, source, file)
}
)
>>>>>>> 19de4ba6b (commiting code to detect failing test)
} }
} else { } else {
setAutoRun(true) setAutoRun(true)
@ -92,10 +105,22 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
} }
const run = (lastCompilationResult, lastCompilationSource, currentFile) => { const run = (lastCompilationResult, lastCompilationSource, currentFile) => {
<<<<<<< HEAD
if (autoRun) { if (autoRun) {
if (lastCompilationResult && categoryIndex.length > 0) { if (lastCompilationResult && categoryIndex.length > 0) {
let warningCount = 0 let warningCount = 0
const warningMessage = [] const warningMessage = []
=======
// const highlightLocation = async (location, fileName) => {
// await props.analysisModule.call('editor', 'discardHighlight')
// await props.analysisModule.call('editor', 'highlight', location, fileName)
// }
setResult({ lastCompilationResult, lastCompilationSource, currentFile })
if (lastCompilationResult && categoryIndex.length) {
setRunButtonState(false)
let warningCount = 0
const warningMessage = []
>>>>>>> 19de4ba6b (commiting code to detect failing test)
runner.run(lastCompilationResult, categoryIndex, results => { runner.run(lastCompilationResult, categoryIndex, results => {
results.map((result) => { results.map((result) => {

Loading…
Cancel
Save