From d85a731e3c398cc6c5f990ebe84fa392d3fe9c9b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Sun, 31 Dec 2023 08:21:41 +0100 Subject: [PATCH] remixd --- .circleci/config.yml | 2 +- apps/remix-ide-e2e/src/tests/remixd.test.ts | 16 ++++++++-------- .../src/lib/components/file-explorer.tsx | 4 ++-- .../workspace/src/lib/reducers/workspace.ts | 18 +++++++++--------- .../workspace/src/lib/remix-ui-workspace.tsx | 2 +- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e27ffb95f..3e59dfa0fb 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 ceebe0d553..db56be22ed 100644 --- a/apps/remix-ide-e2e/src/tests/remixd.test.ts +++ b/apps/remix-ide-e2e/src/tests/remixd.test.ts @@ -71,7 +71,7 @@ module.exports = { '@sources': function () { return sources }, - 'run Remixd tests #group4': function (browser) { + 'run Remixd tests #flaky #group4': function (browser) { browser.perform(async (done) => { remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts')) console.log('working directory', process.cwd()) @@ -81,7 +81,7 @@ module.exports = { runTests(browser, done) }) }, - 'Import from node_modules #group1': function (browser) { + 'Import from node_modules #flaky #group1': function (browser) { /* when a relative import is used (i.e import "openzeppelin-solidity/contracts/math/SafeMath.sol") remix (as well as truffle) try to resolve it against the node_modules and installed_contracts folder. @@ -96,7 +96,7 @@ module.exports = { .setSolidityCompilerVersion('soljson-v0.5.0+commit.1d4f565a.js') .testContracts('test_import_node_modules.sol', sources[3]['test_import_node_modules.sol'], ['SafeMath']) }, - 'Import from node_modules and reference a github import #group2': function (browser) { + 'Import from node_modules and reference a github import #flaky #group2': function (browser) { browser.perform(async (done) => { remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts')) console.log('working directory', process.cwd()) @@ -107,7 +107,7 @@ module.exports = { .setSolidityCompilerVersion('soljson-v0.8.20+commit.a1b79de6.js') // open-zeppelin moved to pragma ^0.8.20 .testContracts('test_import_node_modules_with_github_import.sol', sources[4]['test_import_node_modules_with_github_import.sol'], ['ERC20', 'test11']) }, - 'Static Analysis run with remixd #group3': '' + function (browser) { + 'Static Analysis run with remixd #flaky #group3': '' + function (browser) { browser.testContracts('test_static_analysis_with_remixd_and_hardhat.sol', sources[5]['test_static_analysis_with_remixd_and_hardhat.sol'], ['test5']).pause(2000) .clickLaunchIcon('solidityStaticAnalysis') /* @@ -139,7 +139,7 @@ module.exports = { .scrollAndClick('#pluginManager *[data-id="pluginManagerComponentDeactivateButtonremixd"]') }, - 'Should listen on compilation result from hardhat #group5': function (browser: NightwatchBrowser) { + 'Should listen on compilation result from hardhat #flaky #group5': function (browser: NightwatchBrowser) { browser.perform(async (done) => { remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts/hardhat')) @@ -166,7 +166,7 @@ module.exports = { }, - 'Should load compilation result from hardhat when remixd connects #group6': function (browser: NightwatchBrowser) { + 'Should load compilation result from hardhat when remixd connects #flaky #group6': function (browser: NightwatchBrowser) { // artifacts/build-info/c7062fdd360381a85af23eeef31c98f8.json has already been created browser @@ -194,7 +194,7 @@ module.exports = { }, - 'Should listen on compilation result from foundry #group7': function (browser: NightwatchBrowser) { + 'Should listen on compilation result from foundry #flaky #group7': function (browser: NightwatchBrowser) { browser.perform(async (done) => { remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts/foundry')) @@ -229,7 +229,7 @@ module.exports = { }, - 'Should listen on compilation result from truffle #group8': function (browser: NightwatchBrowser) { + 'Should listen on compilation result from truffle #flaky #group8': function (browser: NightwatchBrowser) { browser.perform(async (done) => { remixd = await spawnRemixd(join(process.cwd(), '/apps/remix-ide', '/contracts/truffle')) diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx index 8dd620b556..ff928e28d7 100644 --- a/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer.tsx @@ -337,9 +337,9 @@ export const FileExplorer = (props: FileExplorerProps) => { } useEffect(() => { - console.log('fe files changed', ROOT_PATH) + console.log('fe files changed', ROOT_PATH, files, flatTree) - }, [files]) + }, [flatTree, files]) useEffect(() => { console.log('FE RENDER', ROOT_PATH) diff --git a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts index 4bc2a5756b..2764cce9db 100644 --- a/libs/remix-ui/workspace/src/lib/reducers/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/reducers/workspace.ts @@ -191,10 +191,10 @@ export const browserReducer = (state = browserInitialState, action: Actions) => console.log('FETCH_DIRECTORY_SUCCESS', payload) const startTime = new Date().getTime() const fd = fetchDirectoryContent(state, payload) - const flatTree = flattenTree(fd, state.browser.expandPath) + const flatTree = flattenTree(fd, state.mode === 'browser'? state.browser.expandPath : state.localhost.expandPath) const endTime = new Date().getTime() - console.log('fetchDirectoryContent tree', endTime - startTime, fd) + console.log('fetchDirectoryContent tree', endTime - startTime, fd, flatTree) return { ...state, @@ -213,7 +213,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => ...state.localhost, files: state.mode === 'localhost' - ? fetchDirectoryContent(state, payload) + ? fd : state.localhost.files, flatTree: state.mode === 'localhost' ? flatTree : state.localhost.flatTree, isRequestingDirectory: false, @@ -266,9 +266,9 @@ export const browserReducer = (state = browserInitialState, action: Actions) => } const startTime = new Date().getTime() const fd = fetchWorkspaceDirectoryContent(state, payload) - const flatTree = flattenTree(fd, state.browser.expandPath) + const flatTree = flattenTree(fd, state.mode === 'browser'? state.browser.expandPath : state.localhost.expandPath) const endTime = new Date().getTime() - console.log('fetchDirectoryContent tree', endTime - startTime, fd) + console.log('fetchDirectoryContent tree', endTime - startTime, fd, flatTree) return { ...state, @@ -454,7 +454,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => case 'ADD_INPUT_FIELD': { const payload = action.payload const fd = fetchDirectoryContent(state, payload) - const flatTree = flattenTree(fd, state.browser.expandPath) + const flatTree = flattenTree(fd, state.mode === 'browser'? state.browser.expandPath : state.localhost.expandPath) return { ...state, browser: { @@ -480,7 +480,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => case 'REMOVE_INPUT_FIELD': { const payload = action.payload const fd = removeInputField(state, payload.path) - const flatTree = flattenTree(fd, state.browser.expandPath) + const flatTree = flattenTree(fd, state.mode === 'browser'? state.browser.expandPath : state.localhost.expandPath) return { ...state, browser: { @@ -515,7 +515,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => case 'FILE_RENAMED_SUCCESS': { const payload = action.payload const fd = fetchDirectoryContent(state, payload, payload.oldPath) - const flatTree = flattenTree(fd, state.browser.expandPath) + const flatTree = flattenTree(fd, state.mode === 'browser'? state.browser.expandPath : state.localhost.expandPath) return { ...state, browser: { @@ -697,7 +697,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => case 'SET_EXPAND_PATH': { const payload = action.payload as string[] - const flatTree = flattenTree(state.browser.files, payload) + const flatTree = flattenTree(state.mode === 'browser' ? state.browser.files : state.localhost.files, payload) return { ...state, browser: { diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index e769cbe100..4cca3a4d55 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -1123,7 +1123,7 @@ export function Workspace() { contextMenuItems={global.fs.localhost.contextMenu.registeredMenuItems} removedContextMenuItems={global.fs.localhost.contextMenu.removedMenuItems} files={global.fs.localhost.files} - flatTree={global.fs.browser.flatTree} + flatTree={global.fs.localhost.flatTree} fileState={[]} workspaceState={state} expandPath={global.fs.localhost.expandPath}