Skip to content

Commit

Permalink
Merge pull request #223 from mirathewhite/verifyCSV
Browse files Browse the repository at this point in the history
Switch to CSV file verification
  • Loading branch information
eztierney authored Oct 4, 2018
2 parents 7059470 + 9f524bf commit 8cbeefd
Show file tree
Hide file tree
Showing 22 changed files with 598 additions and 369 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"assert-diff": "^1.2.6",
"bignumber.js": "6.0.0",
"clone": "2.1.2",
"csv-parse": "3.0.0",
"ethereum-input-data-decoder": "0.0.12",
"ethereumjs-abi": "^0.6.5",
"ethereumjs-tx": "1.3.1",
Expand Down
1 change: 1 addition & 0 deletions test/minting/ControllerTestUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var BigNumber = require('bignumber.js');
var Q = require('q');
var clone = require('clone');

// set to true to enable verbose logging in the tests
var debugLogging = false;
Expand Down
4 changes: 2 additions & 2 deletions truffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = {
* To disable the spreadsheet verification tool ensure that
* the reporter is set to 'Spec' by commenting/uncommenting the lines below.
*/
reporter: 'Spec',
//reporter: './verification/verification_reporter.js',
// reporter: 'Spec',
reporter: "verification/verification_reporter.js",
},
};
255 changes: 0 additions & 255 deletions verification/GoogleSheets/index.js

This file was deleted.

51 changes: 11 additions & 40 deletions verification/README.verification.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The spreadsheet verification tool requires certain naming and usage conventions
to function correctly.

Test Codes:
Unit test codes:

- Should follow the format of lowercase letters followed by a number with
no spaces. (ex. pt001, ept016, misc0000, legacy2, fiat19)
Expand All @@ -11,17 +11,15 @@ Test Codes:

- Should be listed under the 'Code' column of each spreadsheet tab.

Test Titles:

- Should exactly match the test description assigned to the test in the
spreadsheet.
CSV files:
- All CSV files must be in the `verification/Spreadsheets` directory.

Spreadsheet Tabs:

- Should have the same name as the test file they represent.
This name should be formatted BlankTests where Blank consists of uppercase
and/or lowercase letters and is followed without a space by the word 'Tests'.
(ex. PositiveTests, tokenTests, ABITests)
- Each unit test contract block is associated with a single *.csv file.
If the contract block title is 'FiatToken_EventTests' then it will be tested
against FiatToken_EventTests.csv. The verification tool will ignore all
text in the contract block title after a space. 'FiatToken_EventTests Upgraded'
will also be verified against FiatToken_EventTests.csv

- Should include a column 'code' or 'Code' listing all unique test codes that
correspond to tests expected in the test file.
Expand All @@ -33,7 +31,7 @@ Spreadsheet Tabs:

- Should keep the column headers in the top row.

UnitTestCompleteness tab:
UnitTestCompleteness CSV (unsupported):

- The verification tool will print out any test codes that are featured in
the UnitTestCompleteness tab but missing from the test suite.
Expand All @@ -44,11 +42,7 @@ UnitTestCompleteness tab:

Contract Block Titles:

- Should include the name of the test file they run, and this name should not
be immediately preceded by letters.
(ex. If the contract block runs the PositiveTests file, it should be named
'FiatToken_PositiveTests', 'PositiveTestsupgraded', 'PositiveTests' etc.,
but not 'upgradedPositiveTests'.)
- Must match the CSV file name that it is tested against (see CSV files above).

- Should include the word 'Legacy' if they run tests that do not need to be
recorded in the spreadsheet and can be ignored by the verification tool.
Expand All @@ -74,29 +68,6 @@ Pending Tests:

- To DISABLE the spreadsheet verification tool, go to the file truffle.js and
comment out the following line:
reporter: './verification/verification_reporter.js',
reporter: 'verification/verification_reporter.js',
Then, uncomment the line above it.
//reporter: 'Spec',

- To ENABLE the spreadsheet verification tool FOR THE FIRST TIME.

1) Ensure your browser is signed in to your Circle Google account and visit
https://developers.google.com/sheets/api/quickstart/nodejs .

2) Press the blue 'ENABLE THE GOOGLE SHEETS API' button.

3) Enter a project name (i.e. 'spreadsheet-verification') and product name
(i.e 'centre-tokens') and download the credentials.json file.

4) Move your credentials.json file into the verification/GoogleSheets folder.

5) Run 'npm run truffle-test'. You should be prompted to visit a URL and enter a code
that you find there into your terminal. This will create a token.json file
inside the GoogleSheets folder. Note, if a token.json file already exists in
this folder, you will encounter an error.

From there, you should be good to go. This process only needs to be completed
the first time you use the tool.

Note: Ensure that credentials.json and token.json are included in .gitignore
before committing.
Loading

0 comments on commit 8cbeefd

Please sign in to comment.