From 2a50f581243dd990d52a68c7ccf6efc39be120e1 Mon Sep 17 00:00:00 2001 From: Cale Teeter Date: Thu, 5 Nov 2020 15:11:25 -0500 Subject: [PATCH] Update to v160 --- CHANGELOG.md | 10 ++ package.json | 2 +- resources/welcome/prereqs.html | 184 +++++++++++++++++++++------------ src/Constants.ts | 6 +- src/helpers/required.ts | 4 - test/required.test.ts | 119 ++++----------------- 6 files changed, 151 insertions(+), 174 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b0607..edd86ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to the "azure blockchain" extension will be documented in this file. +## 1.6.0 + +### Enhancements + +- Removed the dependency of Python for this extension. This was required by a nested component used by the exntension but has been removed. ([#67](https://github.com/microsoft/vscode-azure-blockchain-ethereum/issues/67) by [@pinakighatak](https://github.com/pinakighatak)) + +### Fixes + +### Internal Improvements + ## 1.5.0 ### Enhancements diff --git a/package.json b/package.json index 3e60be3..bb64b07 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "publisher": "AzBlockchain", "preview": false, "icon": "images/blockchain-service-logo.png", - "version": "1.5.0", + "version": "1.6.0", "repository": { "type": "git", "url": "https://github.com/Microsoft/vscode-azure-blockchain-ethereum" diff --git a/resources/welcome/prereqs.html b/resources/welcome/prereqs.html index 5bb80b0..6de4115 100644 --- a/resources/welcome/prereqs.html +++ b/resources/welcome/prereqs.html @@ -1,73 +1,127 @@ - - - - -
-
-
-
-

Required apps

-
- This extension requires your development machine have the following tools already installed. These cannot be installed directly by the extension. - If you do not have these tools already installed, the links below will take you to the download page -
    -
  • Node JS
  • -
  • Git
  • -
  • Python
  • -
-

- Click here to learn more about this extension, and view the users guide -

-
-
- -
Required version: 10.15.0
- Install Node.js -
-
- -
Required version: 2.10.0
- Install Git -
-
- -
Required version: 2.7.15
- Install Python + + + + +
+
+
+
+

Required apps

+
+ This extension requires your development machine have + the following tools already installed. These cannot be + installed directly by the extension. If you do not have + these tools already installed, the links below will take + you to the download page +
    +
  • Node JS
  • +
  • Git
  • +
  • Python
  • +
+

+ Click here + to learn more about this extension, and view the + users guide +

+
+
+ +
+ Required version: + 10.15.0 +
+ Install Node.js +
+
+ +
+ Required version: + 2.10.0 +
+ Install Git +
+
+ +
+ Required version: + 6.4.1 +
+ Install NPM +
+
+

+ At this time, while the extension is still in + public-preview, you will also need to install the + Truffle Suite of developer tools. Click the links + below to install the Truffle tools directly from + this extension +

+
+
+ +
+ Required version: + 5.0.0 +
+ Install Truffle Suite +
+
+ +
+ Required version: + 6.0.0 +
+ Install Ganache CLI +
+
-

- At this time, while the extension is still in public-preview, you will also need to install the Truffle Suite of developer tools. - Click the links below to install the Truffle tools directly from this extension + +

+ +

-
-
- -
Required version: 6.4.1
- Install NPM -
-
- -
Required version: 5.0.0
- Install Truffle Suite -
-
- -
Required version: 6.0.0
- Install Ganache CLI -
-
- -

- - -

-
-
- - - + + + diff --git a/src/Constants.ts b/src/Constants.ts index 9bf5523..05665d0 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -110,10 +110,6 @@ export class Constants { }, [RequiredApps.node]: '10.15.0', [RequiredApps.npm]: '6.4.1', - [RequiredApps.python]: { - max: '3.0.0', - min: '2.7.15', - }, [RequiredApps.truffle]: { max: '6.0.0', min: '5.0.0', @@ -602,7 +598,7 @@ export class Constants { NoContractBody: 'No contract body in AST', NoSubscriptionFound: 'No subscription found.', NoSubscriptionFoundClick: 'No subscription found, click an Azure account ' + - 'at the bottom left corner and choose Select All', + 'at the bottom left corner and choose Select All', PleaseRenameOldStyleTruffleConfig: 'Please rename file "truffle.js" to "truffle-config.js"', RequiredAppsAreNotInstalled: 'To run command you should install required apps', SolidityContractsNotFound: 'Solidity contracts were not found', diff --git a/src/helpers/required.ts b/src/helpers/required.ts index cc729ca..5a42fcb 100644 --- a/src/helpers/required.ts +++ b/src/helpers/required.ts @@ -144,10 +144,6 @@ export namespace required { currentState.git = currentState.git || await createRequiredVersion(RequiredApps.git, getGitVersion); } - if (apps.includes(RequiredApps.python)) { - currentState.python = currentState.python || - await createRequiredVersion(RequiredApps.python, getPythonVersion); - } if (apps.includes(RequiredApps.truffle)) { currentState.truffle = currentState.truffle || await createRequiredVersion(RequiredApps.truffle, getTruffleVersion); diff --git a/test/required.test.ts b/test/required.test.ts index 3775aab..4dbbccb 100644 --- a/test/required.test.ts +++ b/test/required.test.ts @@ -26,11 +26,6 @@ const gitValidVersion: commands.ICommandResult = { cmdOutputIncludingStderr: '', code: 0, }; -const pythonValidVersion: commands.ICommandResult = { - cmdOutput: ' 2.9.0', - cmdOutputIncludingStderr: '', - code: 0, -}; const truffleValidVersion: commands.ICommandResult = { cmdOutput: 'truffle@5.5.0', cmdOutputIncludingStderr: '', @@ -208,54 +203,6 @@ describe('Required helper', () => { }); }); - describe('getPythonVersion', () => { - it('should return empty string when tryExecuteCommand throws an error', async () => { - // Arrange - tryExecuteCommandMock.throws(TestConstants.testError); - - // Act - const result = await requiredRewire.required.getPythonVersion(); - - // Assert - assert.strictEqual(result, '', 'returned result should be empty'); - assert.strictEqual(tryExecuteCommandMock.calledOnce, true, 'tryExecuteCommand should be called once'); - }); - - it('should return empty string when tryExecuteCommand returns not zero code', async () => { - // Arrange - const executionResult: commands.ICommandResult = { - cmdOutput: ' 11.0.0', - cmdOutputIncludingStderr: '', - code: 1, - }; - tryExecuteCommandMock.returns(executionResult); - - // Act - const result = await requiredRewire.required.getPythonVersion(); - - // Assert - assert.strictEqual(result, '', 'returned result should be empty'); - assert.strictEqual(tryExecuteCommandMock.calledOnce, true, 'tryExecuteCommand should be called once'); - }); - - it('should return version', async () => { - // Arrange - const executionResult: commands.ICommandResult = { - cmdOutput: ' 11.0.0', - cmdOutputIncludingStderr: '', - code: 0, - }; - tryExecuteCommandMock.returns(executionResult); - - // Act - const result = await requiredRewire.required.getPythonVersion(); - - // Assert - assert.strictEqual(result, '11.0.0', 'returned result should be defined'); - assert.strictEqual(tryExecuteCommandMock.calledOnce, true, 'tryExecuteCommand should be called once'); - }); - }); - describe('getTruffleVersion', () => { it('should return local version', async () => { // Arrange @@ -463,16 +410,15 @@ describe('Required helper', () => { tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(gitValidVersion); - tryExecuteCommandMock.onCall(3).returns(pythonValidVersion); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.getAllVersions(); // Assert - assert.strictEqual(result.length, 6, 'returned result should have length 6'); - assert.strictEqual(tryExecuteCommandMock.callCount, 6, 'tryExecuteCommand should be called 6 times'); + assert.strictEqual(result.length, 5, 'returned result should have length 5'); + assert.strictEqual(tryExecuteCommandMock.callCount, 5, 'tryExecuteCommand should be called 5 times'); }); }); @@ -482,21 +428,19 @@ describe('Required helper', () => { tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(gitValidVersion); - tryExecuteCommandMock.onCall(3).returns(pythonValidVersion); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkAppsSilent( RequiredApps.node, RequiredApps.npm, RequiredApps.git, - RequiredApps.python, ); // Assert assert.strictEqual(result, true, 'returned result should be true'); - assert.strictEqual(tryExecuteCommandMock.callCount, 4, 'tryExecuteCommand should be called 4 times'); + assert.strictEqual(tryExecuteCommandMock.callCount, 3, 'tryExecuteCommand should be called 3 times'); }); it('should return false when there are invalid versions', async () => { @@ -506,30 +450,23 @@ describe('Required helper', () => { cmdOutputIncludingStderr: '', code: 0, }; - const executionResultPython: commands.ICommandResult = { - cmdOutput: ' 2.5.0', - cmdOutputIncludingStderr: '', - code: 0, - }; tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(executionResultGit); - tryExecuteCommandMock.onCall(3).returns(executionResultPython); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkAppsSilent( RequiredApps.node, RequiredApps.npm, RequiredApps.git, - RequiredApps.python, ); // Assert assert.strictEqual(result, false, 'returned result should be false'); - assert.strictEqual(tryExecuteCommandMock.callCount, 4, 'tryExecuteCommand should be called 4 times'); + assert.strictEqual(tryExecuteCommandMock.callCount, 3, 'tryExecuteCommand should be called 3 times'); }); }); @@ -539,21 +476,19 @@ describe('Required helper', () => { tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(gitValidVersion); - tryExecuteCommandMock.onCall(3).returns(pythonValidVersion); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkApps( RequiredApps.node, RequiredApps.npm, RequiredApps.git, - RequiredApps.python, ); // Assert assert.strictEqual(result, true, 'returned result should be true'); - assert.strictEqual(tryExecuteCommandMock.callCount, 4, 'tryExecuteCommand should be called 4 times'); + assert.strictEqual(tryExecuteCommandMock.callCount, 3, 'tryExecuteCommand should be called 3 times'); assert.strictEqual(showErrorMessageMock.called, false, 'showErrorMessage shouldn\'t be called'); assert.strictEqual(executeVSCommandMock.called, false, 'executeVSCommand shouldn\'t be called'); }); @@ -565,30 +500,23 @@ describe('Required helper', () => { cmdOutputIncludingStderr: '', code: 0, }; - const executionResultPython: commands.ICommandResult = { - cmdOutput: ' 2.5.0', - cmdOutputIncludingStderr: '', - code: 0, - }; tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(executionResultGit); - tryExecuteCommandMock.onCall(3).returns(executionResultPython); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkApps( RequiredApps.node, RequiredApps.npm, RequiredApps.git, - RequiredApps.python, ); // Assert assert.strictEqual(result, false, 'returned result should be false'); - assert.strictEqual(tryExecuteCommandMock.callCount, 4, 'tryExecuteCommand should be called 4 times'); + assert.strictEqual(tryExecuteCommandMock.callCount, 3, 'tryExecuteCommand should be called 3 times'); assert.strictEqual(showErrorMessageMock.called, true, 'showErrorMessage should be called'); assert.strictEqual(executeVSCommandMock.called, true, 'executeVSCommand should be called'); }); @@ -600,9 +528,8 @@ describe('Required helper', () => { tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(gitValidVersion); - tryExecuteCommandMock.onCall(3).returns(pythonValidVersion); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkRequiredApps(); @@ -621,18 +548,12 @@ describe('Required helper', () => { cmdOutputIncludingStderr: '', code: 0, }; - const executionResultPython: commands.ICommandResult = { - cmdOutput: ' 2.5.0', - cmdOutputIncludingStderr: '', - code: 0, - }; tryExecuteCommandMock.onCall(0).returns(nodeValidVersion); tryExecuteCommandMock.onCall(1).returns(npmValidVersion); tryExecuteCommandMock.onCall(2).returns(executionResultGit); - tryExecuteCommandMock.onCall(3).returns(executionResultPython); - tryExecuteCommandMock.onCall(4).returns(truffleValidVersion); - tryExecuteCommandMock.onCall(5).returns(ganacheValidVersion); + tryExecuteCommandMock.onCall(3).returns(truffleValidVersion); + tryExecuteCommandMock.onCall(4).returns(ganacheValidVersion); // Act const result = await requiredRewire.required.checkRequiredApps();