From 707efe1f680ee3c0f1788deb16c9e2f3967eb0af Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 12:23:05 +0200 Subject: [PATCH 1/8] flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 33 ++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 42af97c095..8de65685f0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: false + default: true orbs: browser-tools: circleci/browser-tools@1.4.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 604277ae6b..e34425b4a9 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -243,7 +243,14 @@ module.exports = { done() }) }) - } + }, + + 'Should install slither #group10 #flaky': function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + await installSlither() + done() + }) + }, } function runTests(browser: NightwatchBrowser, done: any) { @@ -477,3 +484,27 @@ async function buildFoundryProject(): Promise { console.log(e) } } + +async function installSlither(): Promise { + console.log('installSlither', process.cwd()) + try { + const server = spawn('node', ['./dist/libs/remixd/src/scripts/installSlither.js'], { cwd: process.cwd(), shell: true, detached: true }) + return new Promise((resolve, reject) => { + server.stdout.on('data', function (data) { + console.log(data.toString()) + if ( + data.toString().includes("Slither is ready to use") + ) { + console.log('resolving') + resolve() + } + }) + server.stderr.on('err', function (data) { + console.log(data.toString()) + reject(data.toString()) + }) + }) + } catch (e) { + console.log(e) + } +} From 3e838047e4a37a1cdb11e1e529741ec52260c4f4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 12:56:22 +0200 Subject: [PATCH 2/8] run test --- apps/remix-ide-e2e/src/tests/remixd.test.ts | 28 +++++++++++++++++++ .../src/lib/remix-ui-static-analyser.tsx | 6 ++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index e34425b4a9..e9567bd9fc 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -251,6 +251,34 @@ module.exports = { done() }) }, + 'Should perform slither analysis #group10': function (browser: NightwatchBrowser) { + + browser.perform(async (done) => { + try { + remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts')) + } catch (err) { + console.error(err) + } + console.log('working directory', process.cwd()) + connectRemixd(browser, done) + }) + .openFile('ballot.sol') + .pause(2000) + .clickLaunchIcon('solidityStaticAnalysis') + .useXpath() + .click('//*[@id="staticAnalysisRunBtn"]') + .waitForElementPresent('//*[@id="staticanalysisresult"]', 5000) + .waitForElementVisible({ + selector: "//*[@data-id='nolibslitherwarnings'][contains(text(), '3')]", + locateStrategy: 'xpath', + timeout: 5000 + }) + .waitForElementVisible({ + selector: "//div[@data-id='block']/span[contains(text(), '3 warnings found.')]", + locateStrategy: 'xpath', + timeout: 5000 + }) + } } function runTests(browser: NightwatchBrowser, done: any) { diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 5840411c30..7b3241481d 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -721,11 +721,11 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => { Slither {slitherWarnings.length > 0 ? ( hideWarnings ? ( - {slitherErrors.length} + {slitherErrors.length} ) : showLibsWarning && !hideWarnings ? ( - 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{slitherWarnings.length} + 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{slitherWarnings.length} ) : ( - 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{noLibSlitherWarnings.length} + 0 ? `badge-danger` : 'badge-warning'} badge-pill mx-1 ml-1 text-center`}>{noLibSlitherWarnings.length} ) ) : null} From 0e4ad682cf0d23c8c596c593949ccac2f1b9522e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:00:00 +0200 Subject: [PATCH 3/8] install pip3 --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8de65685f0..e8ac42634b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -364,6 +364,7 @@ jobs: - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules || yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: mkdir node_modules/hardhat && wget https://unpkg.com/hardhat/console.sol -O node_modules/hardhat/console.sol - run: ls -la ./dist/apps/remix-ide/assets/js + - run: apt install python3-pip -y - when: condition: equal: [ "chrome", << parameters.browser >> ] From 902438dc95704863b8a233c0badf1255d947521b Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:05:56 +0200 Subject: [PATCH 4/8] sudo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8ac42634b..b60dd21f9e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -364,7 +364,7 @@ jobs: - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules || yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: mkdir node_modules/hardhat && wget https://unpkg.com/hardhat/console.sol -O node_modules/hardhat/console.sol - run: ls -la ./dist/apps/remix-ide/assets/js - - run: apt install python3-pip -y + - run: sudo apt install python3-pip -y - when: condition: equal: [ "chrome", << parameters.browser >> ] From ed7bbbd615b5396709faf8807fd475342e508727 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:13:48 +0200 Subject: [PATCH 5/8] python orb --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b60dd21f9e..7d196e5cbd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,7 @@ parameters: orbs: browser-tools: circleci/browser-tools@1.4.4 win: circleci/windows@5.0 + python: medasync/python@3.2.0 jobs: build: docker: From 8c80641e346582e6d5f8416cc788946127e52e3f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:16:15 +0200 Subject: [PATCH 6/8] update --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7d196e5cbd..1c65bbcc40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,6 @@ parameters: orbs: browser-tools: circleci/browser-tools@1.4.4 win: circleci/windows@5.0 - python: medasync/python@3.2.0 jobs: build: docker: @@ -365,7 +364,7 @@ jobs: - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules || yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: mkdir node_modules/hardhat && wget https://unpkg.com/hardhat/console.sol -O node_modules/hardhat/console.sol - run: ls -la ./dist/apps/remix-ide/assets/js - - run: sudo apt install python3-pip -y + - run: sudo apt update && sudo apt install python3-pip -y - when: condition: equal: [ "chrome", << parameters.browser >> ] From 43be1c2de44b7af9fca79aef40b642eb535fcc7e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:24:19 +0200 Subject: [PATCH 7/8] turn off flaky --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c65bbcc40..c8be5e0d7a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: run_flaky_tests: type: boolean - default: true + default: false orbs: browser-tools: circleci/browser-tools@1.4.4 win: circleci/windows@5.0 diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index e9567bd9fc..0fd47bca9f 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -245,7 +245,7 @@ module.exports = { }) }, - 'Should install slither #group10 #flaky': function (browser: NightwatchBrowser) { + 'Should install slither #group10': function (browser: NightwatchBrowser) { browser.perform(async (done) => { await installSlither() done() From a0102b10870f620e8aad84cadb1fc900d5f11e7f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Jun 2024 13:35:27 +0200 Subject: [PATCH 8/8] group6 --- apps/remix-ide-e2e/src/tests/remixd.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 0fd47bca9f..c26d9b22fa 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -245,13 +245,13 @@ module.exports = { }) }, - 'Should install slither #group10': function (browser: NightwatchBrowser) { + 'Should install slither #group6': function (browser: NightwatchBrowser) { browser.perform(async (done) => { await installSlither() done() }) }, - 'Should perform slither analysis #group10': function (browser: NightwatchBrowser) { + 'Should perform slither analysis #group6': function (browser: NightwatchBrowser) { browser.perform(async (done) => { try {