From a71f59d9188477c388b97dcbd42793ab6de44c9e Mon Sep 17 00:00:00 2001 From: lianahus Date: Thu, 6 May 2021 20:18:17 +0200 Subject: [PATCH 1/5] adding pause --- apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index ec65abce49..b60cd045e4 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -81,6 +81,7 @@ module.exports = { .waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]') .clickElementAtPosition('.singleTestLabel', 0) .clickElementAtPosition('.singleTestLabel', 1) + .pause(5000) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') .pause(5000) .click('*[data-id="testTabRunTestsTabStopAction"]') From 3881faaff1752dd725c5084b27d3a75dad2a650b Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 10 May 2021 11:24:46 +0200 Subject: [PATCH 2/5] cleaning old results og SUT plugin --- apps/remix-ide/src/app/tabs/test-tab.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/test-tab.js b/apps/remix-ide/src/app/tabs/test-tab.js index f1ff124df5..eb6edd4efb 100644 --- a/apps/remix-ide/src/app/tabs/test-tab.js +++ b/apps/remix-ide/src/app/tabs/test-tab.js @@ -76,6 +76,7 @@ module.exports = class TestTab extends ViewPlugin { this.updateGenerateFileAction() if (!this.areTestsRunning) this.updateRunAction(file) this.updateTestFileList() + this.clearResults() this.testTabLogic.getTests((error, tests) => { if (error) return tooltip(error) this.data.allTests = tests @@ -434,21 +435,26 @@ module.exports = class TestTab extends ViewPlugin { this.uiPathList.appendChild(yo``) } + clearResults () { + yo.update(this.resultStatistics, yo``) + this.call('editor', 'clearAnnotations') + this.testsOutput.innerHTML = '' + this.testsOutput.hidden = true + this.testsExecutionStopped.hidden = true + this.testsExecutionStoppedError.hidden = true + } + runTests () { this.areTestsRunning = true this.hasBeenStopped = false this.readyTestsNumber = 0 this.runningTestsNumber = this.data.selectedTests.length - yo.update(this.resultStatistics, this.createResultLabel()) const stopBtn = document.getElementById('runTestsTabStopAction') stopBtn.removeAttribute('disabled') const runBtn = document.getElementById('runTestsTabRunAction') runBtn.setAttribute('disabled', 'disabled') - this.call('editor', 'clearAnnotations') - this.testsOutput.innerHTML = '' - this.testsOutput.hidden = true - this.testsExecutionStopped.hidden = true - this.testsExecutionStoppedError.hidden = true + this.clearResults() + yo.update(this.resultStatistics, this.createResultLabel()) const tests = this.data.selectedTests if (!tests) return this.resultStatistics.hidden = tests.length === 0 From 42ecc53167d5d047a4809ef760637c1e1a7e689c Mon Sep 17 00:00:00 2001 From: lianahus Date: Mon, 10 May 2021 11:45:04 +0200 Subject: [PATCH 3/5] test --- apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts index b60cd045e4..3601539f3d 100644 --- a/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts +++ b/apps/remix-ide-e2e/src/tests/solidityUnittests.spec.ts @@ -81,9 +81,8 @@ module.exports = { .waitForElementPresent('*[data-id="testTabRunTestsTabRunAction"]') .clickElementAtPosition('.singleTestLabel', 0) .clickElementAtPosition('.singleTestLabel', 1) - .pause(5000) .scrollAndClick('*[data-id="testTabRunTestsTabRunAction"]') - .pause(5000) + .pause(2000) .click('*[data-id="testTabRunTestsTabStopAction"]') .waitForElementContainsText('*[data-id="testTabRunTestsTabStopAction"]', 'Stopping', 60000) .waitForElementContainsText('*[data-id="testTabSolidityUnitTestsOutput"]', '/tests/ks2b_test.sol', 120000) From d886b0fb53e57fae9ef9e6d7982cfce4cc961ac5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 10 May 2021 21:27:57 +0200 Subject: [PATCH 4/5] fix extracting parentScope (#1157) fix https://github.com/ethereum/remix-project/issues/1153 --- libs/remix-debug/src/solidity-decoder/internalCallTree.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts index f798b7beff..acdeae4749 100644 --- a/libs/remix-debug/src/solidity-decoder/internalCallTree.ts +++ b/libs/remix-debug/src/solidity-decoder/internalCallTree.ts @@ -108,7 +108,8 @@ export class InternalCallTree { } parentScope (scopeId) { - return scopeId.replace(/(.\d|\d)$/, '') + if (scopeId.indexOf('.') === -1) return '' + return scopeId.replace(/(\.\d+)$/, '') } findScopeId (vmtraceIndex) { From 4bb5e13b5b1bf446c7b92e203f11d5c2f03000e3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 10 May 2021 21:40:57 +0200 Subject: [PATCH 5/5] Warn if current is not the last version (#1161) fix https://github.com/ethereum/remix-project/issues/938 --- libs/remixd/package.json | 4 +++- libs/remixd/src/bin/remixd.ts | 16 ++++++++++++++++ package-lock.json | 20 ++++++-------------- package.json | 3 ++- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 607b0a7ff2..6bbfed0109 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -44,7 +44,9 @@ "commander": "^2.20.3", "fs-extra": "^3.0.1", "isbinaryfile": "^3.0.2", - "ws": "^7.3.0" + "ws": "^7.3.0", + "latest-version": "^5.1.0", + "semver": "^6.3.0" }, "python": { "execPath": "python3", diff --git a/libs/remixd/src/bin/remixd.ts b/libs/remixd/src/bin/remixd.ts index ae240a8cdf..5b7076fd0d 100644 --- a/libs/remixd/src/bin/remixd.ts +++ b/libs/remixd/src/bin/remixd.ts @@ -1,4 +1,6 @@ #!/usr/bin/env node +import latestVersion from 'latest-version' +import * as semver from 'semver' import WebSocket from '../websocket' import * as servicesList from '../serviceList' import * as WS from 'ws' // eslint-disable-line @@ -8,6 +10,18 @@ import * as fs from 'fs-extra' import * as path from 'path' import * as program from 'commander' +async function warnLatestVersion () { + const latest = await latestVersion('@remix-project/remixd') + const pjson = require('../package.json') + if (semver.eq(latest, pjson.version)) { + console.log('\x1b[32m%s\x1b[0m', `[INFO] you are using the latest version ${latest}`) + } else if (semver.gt(latest, pjson.version)) { + console.log('\x1b[33m%s\x1b[0m', `[WARN] latest version of remixd is ${latest}, you are using ${pjson.version}`) + console.log('\x1b[33m%s\x1b[0m', '[WARN] please update using the following command:') + console.log('\x1b[33m%s\x1b[0m', '[WARN] npm install @remix-project/remixd -g') + } +} + const services = { git: (readOnly: boolean) => new servicesList.GitClient(readOnly), folder: (readOnly: boolean) => new servicesList.Sharedfolder(readOnly) @@ -40,6 +54,8 @@ function startService (service: S, callback: (ws: WS }).parse(process.argv) // eslint-disable-next-line + await warnLatestVersion() + if (!program.remixIde) { console.log('\x1b[33m%s\x1b[0m', '[WARN] You can only connect to remixd from one of the supported origins.') } else { diff --git a/package-lock.json b/package-lock.json index b2c38f3b0f..4f92e09fa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15178,8 +15178,7 @@ "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "deep-is": { "version": "0.1.3", @@ -21217,8 +21216,7 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "init-package-json": { "version": "1.10.3", @@ -24668,7 +24666,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, "requires": { "package-json": "^6.3.0" } @@ -33827,7 +33824,6 @@ "version": "6.5.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, "requires": { "got": "^9.6.0", "registry-auth-token": "^4.0.0", @@ -35709,7 +35705,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -36217,10 +36212,9 @@ } }, "registry-auth-token": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.0.tgz", - "integrity": "sha512-P+lWzPrsgfN+UEpDS3U8AQKg/UjZX6mQSJueZj3EK+vNESoqBSpBUD3gmu4sF9lOsjXWjF11dQKUqemf3veq1w==", - "dev": true, + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", + "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", "requires": { "rc": "^1.2.8" } @@ -36229,7 +36223,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, "requires": { "rc": "^1.2.8" } @@ -39088,8 +39081,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "strong-log-transformer": { "version": "2.1.0", diff --git a/package.json b/package.json index bd2a0e8aa6..2587e3bfbf 100644 --- a/package.json +++ b/package.json @@ -159,6 +159,7 @@ "isbinaryfile": "^3.0.2", "jquery": "^3.3.1", "jszip": "^3.6.0", + "latest-version": "^5.1.0", "merge": "^1.2.0", "npm-install-version": "^6.0.2", "react": "16.13.1", @@ -273,7 +274,7 @@ "request": "^2.83.0", "rimraf": "^2.6.1", "selenium-standalone": "^6.17.0", - "semver": "^6.1.2", + "semver": "^6.3.0", "solc": "0.7.4", "swarmgw": "^0.3.1", "tap-spec": "^5.0.0",