diff --git a/apps/remix-ide-e2e/nightwatch-chrome.ts b/apps/remix-ide-e2e/nightwatch-chrome.ts index 8f1a02c923..f1b95992eb 100644 --- a/apps/remix-ide-e2e/nightwatch-chrome.ts +++ b/apps/remix-ide-e2e/nightwatch-chrome.ts @@ -21,7 +21,7 @@ module.exports = { 'default': { globals: { waitForConditionTimeout: 10000, - asyncHookTimeout: 100000 + asyncHookTimeout: 10000000 }, screenshots: { enabled: true, diff --git a/apps/remix-ide-e2e/nightwatch-firefox.ts b/apps/remix-ide-e2e/nightwatch-firefox.ts index f8b8d8a083..30777fb5ee 100644 --- a/apps/remix-ide-e2e/nightwatch-firefox.ts +++ b/apps/remix-ide-e2e/nightwatch-firefox.ts @@ -18,7 +18,7 @@ module.exports = { 'default': { globals: { waitForConditionTimeout: 10000, - asyncHookTimeout: 100000 + asyncHookTimeout: 10000000 }, screenshots: { enabled: true, diff --git a/apps/remix-ide-e2e/src/tests/remixd.test.ts b/apps/remix-ide-e2e/src/tests/remixd.test.ts index 5c38dac0c9..28744fbc57 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -71,7 +71,11 @@ module.exports = { }, 'run Remixd tests #group1': function (browser) { browser.perform(async (done) => { - remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts')) + 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) }) @@ -267,10 +271,34 @@ function testImportFromRemixd(browser: NightwatchBrowser, callback: VoidFunction .perform(() => { callback() }) } +async function installRemixd(): Promise { + console.log('installRemixd') + const remixd = spawn('yarn install', [], { cwd: process.cwd() + '/dist/libs/remixd', shell: true, detached: true }) + return new Promise((resolve, reject) => { + remixd.stdout.on('data', function (data) { + console.log(data.toString()) + if( + data.toString().includes('success Saved lockfile') + || data.toString().includes('success Already up-to-date') + ) { + + resolve() + } + }) + remixd.stderr.on('err', function (data) { + console.log(data.toString()) + reject(data.toString()) + }) + }) +} + async function spawnRemixd(path: string): Promise { + console.log('spawnRemixd', path) + await installRemixd() const remixd = spawn('chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js --remix-ide http://127.0.0.1:8080', [`-s ${path}`], { cwd: process.cwd(), shell: true, detached: true }) return new Promise((resolve, reject) => { remixd.stdout.on('data', function (data) { + console.log(data.toString()) if( data.toString().includes('is listening') || data.toString().includes('There is already a client running') @@ -280,6 +308,7 @@ async function spawnRemixd(path: string): Promise { } }) remixd.stderr.on('err', function (data) { + console.log(data.toString()) reject(data.toString()) }) }) @@ -310,20 +339,12 @@ function connectRemixd(browser: NightwatchBrowser, done: any) { async function setupHardhatProject(): Promise { console.log(process.cwd()) try { - const server = spawn('git clone https://github.com/NomicFoundation/hardhat-boilerplate && cd hardhat-boilerplate && npm install && echo "END"', [], { cwd: process.cwd() + '/apps/remix-ide', shell: true, detached: true }) + const server = spawn('git clone https://github.com/NomicFoundation/hardhat-boilerplate && cd hardhat-boilerplate && yarn install && echo "END"', [], { cwd: process.cwd() + '/apps/remix-ide', shell: true, detached: true }) return new Promise((resolve, reject) => { - server.stdout.on('data', function (data) { - console.log(data.toString()) - if ( - data.toString().includes("END") - ) { - console.log('resolving') - resolve() - } - }) - server.stderr.on('err', function (data) { - console.log(data.toString()) - reject(data.toString()) + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() }) }) } catch (e) { @@ -336,18 +357,10 @@ async function compileHardhatProject(): Promise { try { const server = spawn('npx hardhat compile', [], { cwd: process.cwd() + '/apps/remix-ide/hardhat-boilerplate', shell: true, detached: true }) return new Promise((resolve, reject) => { - server.stdout.on('data', function (data) { - console.log(data.toString()) - if ( - data.toString().includes("END") - ) { - console.log('resolving') - resolve() - } - }) - server.stderr.on('err', function (data) { - console.log(data.toString()) - reject(data.toString()) + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() }) }) } catch (e) { diff --git a/apps/remix-ide/hardhat-boilerplate b/apps/remix-ide/hardhat-boilerplate new file mode 160000 index 0000000000..638fd58ec8 --- /dev/null +++ b/apps/remix-ide/hardhat-boilerplate @@ -0,0 +1 @@ +Subproject commit 638fd58ec882990d3b654d45e37907eb15695bd2 diff --git a/libs/remixd/package.json b/libs/remixd/package.json index 27137f6cea..d0153806c8 100644 --- a/libs/remixd/package.json +++ b/libs/remixd/package.json @@ -31,6 +31,7 @@ "@remixproject/plugin-api": "0.3.33", "@remixproject/plugin-utils": "0.3.33", "@remixproject/plugin-ws": "0.3.33", + "@remix-project/remix-solidity": "^0.5.36", "axios": "1.6.0", "chokidar": "^2.1.8", "commander": "^9.4.1",