From 1277c26463133e4aae38af87d949f6f26f3a348d Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 Jun 2018 11:07:33 +0200 Subject: [PATCH 1/2] fix currentPath() --- .circleci/config.yml | 12 ++++++------ src/app/files/fileManager.js | 2 +- src/app/panels/righthand-panel.js | 4 ++-- src/app/tabs/test-tab.js | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1084cc3175..0bc31f0176 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: remix-ide: docker: # specify the version you desire here - - image: circleci/node:7.10 + - image: circleci/node:9.11.2 # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images @@ -26,10 +26,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-12-{{ checksum "package.json" }} + - dep-bundle-13-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-12-{{ checksum "package.json" }} + key: dep-bundle-13-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build @@ -38,7 +38,7 @@ jobs: remix-debugger: docker: # specify the version you desire here - - image: circleci/node:7.10 + - image: circleci/node:9.11.2 working_directory: ~/repo @@ -46,10 +46,10 @@ jobs: - checkout - restore_cache: keys: - - dep-bundle-7-{{ checksum "package.json" }} + - dep-bundle-8-{{ checksum "package.json" }} - run: npm install - save_cache: - key: dep-bundle-7-{{ checksum "package.json" }} + key: dep-bundle-8-{{ checksum "package.json" }} paths: - ~/repo/node_modules - run: npm run build_debugger diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 920deda659..1bf307e815 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -74,7 +74,7 @@ class FileManager { currentPath () { var self = this var currentFile = self._deps.config.get('currentFile') - var reg = /(.*\/).*/ + var reg = /(.*)(\/).*/ var path = reg.exec(currentFile) return path ? path[1] : null } diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index 00921dcffa..23366d8a61 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -111,14 +111,14 @@ module.exports = class RighthandPanel { ` - const { compile, run, settings, analysis, debug, support } = self._components + const { compile, run, settings, analysis, debug, support, test } = self._components self._components.tabbedMenu.addTab('Compile', 'compileView', compile.render()) self._components.tabbedMenu.addTab('Run', 'runView', run.render()) self._components.tabbedMenu.addTab('Settings', 'settingsView', settings.render()) self._components.tabbedMenu.addTab('Analysis', 'staticanalysisView', analysis.render()) self._components.tabbedMenu.addTab('Debugger', 'debugView', debug.render()) self._components.tabbedMenu.addTab('Support', 'supportView', support.render()) - // self._components.tabbedMenu.addTab('Test', 'testView', test.render()) + self._components.tabbedMenu.addTab('Test', 'testView', test.render()) self._components.tabbedMenu.selectTabByTitle('Compile') } // showDebugger () { diff --git a/src/app/tabs/test-tab.js b/src/app/tabs/test-tab.js index 7e58a52282..1d49eb08a3 100644 --- a/src/app/tabs/test-tab.js +++ b/src/app/tabs/test-tab.js @@ -68,8 +68,7 @@ module.exports = class TestTab { }) } - function runTest (testFilePath, callback) { - var provider = this._deps.fileManager.fileProviderOf(testFilePath) + function runTest (testFilePath, provider, callback) { provider.get(testFilePath, (error, content) => { if (!error) { var runningTest = {} @@ -85,13 +84,14 @@ module.exports = class TestTab { let runTests = function () { container.innerHTML = '' var path = this._deps.fileManager.currentPath() + var provider = this._deps.fileManager.fileProviderOf(path) var tests = [] self._deps.fileManager.filesFromPath(path, (error, files) => { if (!error) { for (var file in files) { - if (/.(_test.sol)$/.exec(file)) tests.push(path + file) + if (/.(_test.sol)$/.exec(file)) tests.push(provider.type + '/' + file) } - async.eachOfSeries(tests, (value, key, callback) => { runTest(value, callback) }) + async.eachOfSeries(tests, (value, key, callback) => { runTest(value, provider, callback) }) } }) } From 343e97d5ffbaaa428ed1f5a0525441de9bbc5cb8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 26 Jun 2018 10:57:03 +0200 Subject: [PATCH 2/2] fix current path --- src/app/tabs/run-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index a99f326907..75589c0ff0 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -266,7 +266,7 @@ function makeRecorder (registry, runTabEvent, self) { modalDialogCustom.prompt(null, 'Transactions will be saved in a file under ' + path, 'scenario.json', input => { var fileProvider = fileManager.fileProviderOf(path) if (fileProvider) { - var newFile = path + input + var newFile = path + '/' + input helper.createNonClashingName(newFile, fileProvider, (error, newFile) => { if (error) return modalDialogCustom.alert('Failed to create file. ' + newFile + ' ' + error) if (!fileProvider.set(newFile, txJSON)) {