Bläddra i källkod

HUE-8888 [docs] Show to how run single test file in parser guide

Romain 5 år sedan
förälder
incheckning
1809d02d8d
3 ändrade filer med 10 tillägg och 10 borttagningar
  1. 2 2
      README.md
  2. 2 2
      docs/docs-site/content/_index.md
  3. 6 6
      docs/docs-site/content/developer/parsers/_index.md

+ 2 - 2
README.md

@@ -8,14 +8,14 @@
 Query. Explore. Share.
 ----------------------
 
-Hue is a mature open source SQL Assistant for querying [Databases & Data Warehouses](https://docs.gethue.com/administrator/configuration/connectors/) and collaborating: [gethue.com](http://gethue.com)
+Hue is a mature open source SQL Assistant for [querying](https://docs.gethue.com/user/querying/) [Databases & Data Warehouses](https://docs.gethue.com/administrator/configuration/connectors/) and collaborating: [gethue.com](http://gethue.com)
 
 Many companies and organizations use Hue to quickly answer questions via self-service querying e.g.:
 
 * 1000+ customers
 * Top Fortune 500
 
-are executing 100s of 1000s of queries daily. It also ships in Cloudera Data Platform, Amazon AWS, Open Data Hub...
+are executing 100s of 1000s of queries daily. It also [ships](https://docs.gethue.com/administrator/installation/) in Cloudera Data Platform, Amazon AWS, Open Data Hub...
 
 Hue is also ideal for building your own [Cloud SQL Editor](https://docs.gethue.com/developer/parsers/) and any [contributions](CONTRIBUTING.md) are welcome.
 

+ 2 - 2
docs/docs-site/content/_index.md

@@ -9,14 +9,14 @@ pre = "<b>1. </b>"
 
 <h1>Documentation</h1>
 
-Hue is a mature open source SQL Assistant for querying [Databases & Data Warehouses](https://docs.gethue.com/administrator/configuration/connectors/) and collaborating: [gethue.com](http://gethue.com)
+Hue is a mature open source SQL Assistant for [querying](/user/querying/) [Databases & Data Warehouses](https://docs.gethue.com/administrator/configuration/connectors/) and collaborating: [gethue.com](http://gethue.com)
 
 Many companies and organizations use Hue to quickly answer questions via self-service querying e.g.:
 
 * 1000+ customers
 * Top Fortune 500
 
-are executing 100s of 1000s of queries daily. It also ships in Cloudera Data Platform, Amazon AWS, Open Data Hub...
+are executing 100s of 1000s of queries daily. It also [ships](/administrator/installation/) in Cloudera Data Platform, Amazon AWS, Open Data Hub...
 
 Hue is also ideal for building your own [Cloud SQL Editor](https://docs.gethue.com/developer/parsers/) and any [contributions](CONTRIBUTING.md) are welcome.
 

+ 6 - 6
docs/docs-site/content/developer/parsers/_index.md

@@ -151,7 +151,7 @@ This gives you an idea on how to add custom syntax to the newly generated postgr
 
 We’ll start by adding a test, in `postgresqlAutocompleteParser.test.js` in the test folder inside the main describe function before the first `it('should...`:
 
-    fdescribe('REINDEX', () => {
+    describe('REINDEX', () => {
       it('should handle "REINDEX TABLE foo FORCE; |"', () => {
         assertAutoComplete({
           beforeCursor: 'REINDEX TABLE foo FORCE;  ',
@@ -177,7 +177,7 @@ We’ll start by adding a test, in `postgresqlAutocompleteParser.test.js` in the
       });
     });
 
-When we now run `npm run test` there should be two failing tests.
+When we now run `npm run test -- postgresqlAutocompleteParser.test.js` there should be two failing tests.
 
 Next we’ll have to add the keyword to the lexer, let’s open `sql.jisonlex` in the jison folder for postgresql and add the following new tokens:
 
@@ -210,7 +210,7 @@ Now let’s add the grammar, starting with the complete specification. For simpl
 
 "DataDefinition" is an existing rule and this extends that rule with "ReindexStatement".
 
-Save the files and first run `node tools/jison/generateParsers.js postgresql` then `npm run test` and we should be down to one failing test.
+Save the files and first run `node tools/jison/generateParsers.js postgresql` then `npm run test -- postgresqlAutocompleteParser.test.js` and we should be down to one failing test.
 
 For the next one we’ll add some keyword suggestions after the user has typed REINDEX, we’ll continue below the ReindexStatement in `sql_main.jison`:
 
@@ -225,7 +225,7 @@ For the next one we’ll add some keyword suggestions after the user has typed R
       }
     ;
 
-Again, run `node tools/jison/generateParsers.js postgresql` then `npm run test` and the tests should both be green.
+Again, run `node tools/jison/generateParsers.js postgresql` then `npm run test -- postgresqlAutocompleteParser.test.js` and the tests should both be green.
 
 We also want the autocompleter to suggest the keyword REINDEX when the user hasn’t typed anything, to do that let’s first add the following test with the other new ones in `postgresqlAutocompleteParser.test.js`:
 
@@ -241,9 +241,9 @@ We also want the autocompleter to suggest the keyword REINDEX when the user hasn
       });
     });
 
-For this to pass we need to add REINDEX to the list of DDL and DML keywords in the file `sqlParseSupport.js` next to the generated parser (`desktop/core/src/desktop/js/parse/sql/postgresql/sqlParseSupport.js/`). Find the function `parser.suggestDdlAndDmlKeywords` and add ‘REINDEX’ to the keywords array. Now run `npm run test` and the three tests should pass.
+For this to pass we need to add REINDEX to the list of DDL and DML keywords in the file `sqlParseSupport.js` next to the generated parser (`desktop/core/src/desktop/js/parse/sql/postgresql/sqlParseSupport.js/`). Find the function `parser.suggestDdlAndDmlKeywords` and add ‘REINDEX’ to the keywords array. Now run `npm run test -- postgresqlAutocompleteParser.test.js` and the three tests should pass.
 
-Before you continue further be sure to remove the ‘f’ from ‘fdescribe’ in the spec to allow all other tests to run. Note that in this case there will be two new failing tests where the keyword ‘REINDEX’ has to be added.
+Before you continue further, note that in this case there will be two new failing tests where the keyword ‘REINDEX’ has to be added.
 
 In order to use the newly generated parsers we have to add them to the webpack bundles: