-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manifest sourcing & mutliple formats
- Loading branch information
1 parent
50d74a9
commit 99b5ad6
Showing
15 changed files
with
338 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
__tests__/dummy-projects/29-manifest-loading/defaults/manifest-defaults.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
rule: | ||
no_override: | ||
match: "$" | ||
rule_expr: "false" | ||
expr_rule: "false" | ||
partial_override: | ||
match: "$" | ||
rule_expr: "false" | ||
expr_rule: "false" | ||
full_override: | ||
match: "$" | ||
rule_expr: "false" | ||
expr_rule: "false" |
4 changes: 2 additions & 2 deletions
4
__tests__/dummy-projects/29-manifest-loading/defaults/manifest.lkml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# LAMS | ||
# rule: partial_override { | ||
# expr_match: true ;; | ||
# expr_rule: true ;; | ||
# } | ||
# rule: full_override { | ||
# match: "$" | ||
# expr_match: true ;; | ||
# expr_rule: true ;; | ||
#} |
61 changes: 61 additions & 0 deletions
61
__tests__/dummy-projects/29-manifest-loading/inline-json/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
let {testName, lams, options, mocks} = require('../../../../lib/test-commons.js')(__dirname,{dirnameOffset:-2}) | ||
|
||
options = {...options, manifest:`{"rule":{"bad":{ | ||
"match":"$", | ||
"expr_rule": "false" | ||
}}}`} | ||
|
||
describe('Projects', () => { | ||
describe(testName, () => { | ||
let {spies, process, console} = mocks() | ||
let messages | ||
beforeAll( async () => { | ||
messages = await lams(options,{process, console}); | ||
}) | ||
it("should not error out", ()=> { | ||
expect(console.error).not.toHaveBeenCalled() | ||
}); | ||
it("it should not contain any unexpected parser (P0) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P0", | ||
level: "error" | ||
}); | ||
}); | ||
it("it should not contain any parser syntax (P1) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P1", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`bad` should provide correct aggregate info (1 match, 0 exempt, 1 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "info", | ||
description: "Rule bad summary: 1 matches, 0 matches exempt, and 1 errors" | ||
}); | ||
}); | ||
|
||
it("it should error on bad", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`ok` should provide correct aggregate info (1 match, 0 exempt, 0 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "ok", | ||
level: "info", | ||
description: "Rule ok summary: 1 matches, 0 matches exempt, and 0 errors" | ||
}); | ||
}); | ||
|
||
it("it should not error on ok", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "ok", | ||
level: "error" | ||
}); | ||
}); | ||
}); | ||
}); |
9 changes: 9 additions & 0 deletions
9
__tests__/dummy-projects/29-manifest-loading/inline-json/manifest.lkml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# LAMS | ||
# rule: ok { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
# } | ||
# rule: bad { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
#} |
58 changes: 58 additions & 0 deletions
58
__tests__/dummy-projects/29-manifest-loading/lkml-path/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
let {testName, lams, options, mocks} = require('../../../../lib/test-commons.js')(__dirname,{dirnameOffset:-2}) | ||
|
||
options = {...options, manifest:`./manifest.lams-lkml`} | ||
|
||
describe('Projects', () => { | ||
describe(testName, () => { | ||
let {spies, process, console} = mocks() | ||
let messages | ||
beforeAll( async () => { | ||
messages = await lams(options,{process, console}); | ||
}) | ||
it("should not error out", ()=> { | ||
expect(console.error).not.toHaveBeenCalled() | ||
}); | ||
it("it should not contain any unexpected parser (P0) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P0", | ||
level: "error" | ||
}); | ||
}); | ||
it("it should not contain any parser syntax (P1) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P1", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`bad` should provide correct aggregate info (1 match, 0 exempt, 1 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "info", | ||
description: "Rule bad summary: 1 matches, 0 matches exempt, and 1 errors" | ||
}); | ||
}); | ||
|
||
it("it should error on bad", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`ok` should provide correct aggregate info (1 match, 0 exempt, 0 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "ok", | ||
level: "info", | ||
description: "Rule ok summary: 1 matches, 0 matches exempt, and 0 errors" | ||
}); | ||
}); | ||
|
||
it("it should not error on ok", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "ok", | ||
level: "error" | ||
}); | ||
}); | ||
}); | ||
}); |
4 changes: 4 additions & 0 deletions
4
__tests__/dummy-projects/29-manifest-loading/lkml-path/manifest.lams-lkml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rule: bad { | ||
match: "$" | ||
expr_rule: false;; | ||
} |
9 changes: 9 additions & 0 deletions
9
__tests__/dummy-projects/29-manifest-loading/lkml-path/manifest.lkml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# LAMS | ||
# rule: ok { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
# } | ||
# rule: bad { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
#} |
58 changes: 58 additions & 0 deletions
58
__tests__/dummy-projects/29-manifest-loading/yaml-path/index.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
let {testName, lams, options, mocks} = require('../../../../lib/test-commons.js')(__dirname,{dirnameOffset:-2}) | ||
|
||
options = {...options, manifest:`./lams-manifest.yml`} | ||
|
||
describe('Projects', () => { | ||
describe(testName, () => { | ||
let {spies, process, console} = mocks() | ||
let messages | ||
beforeAll( async () => { | ||
messages = await lams(options,{process, console}); | ||
}) | ||
it("should not error out", ()=> { | ||
expect(console.error).not.toHaveBeenCalled() | ||
}); | ||
it("it should not contain any unexpected parser (P0) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P0", | ||
level: "error" | ||
}); | ||
}); | ||
it("it should not contain any parser syntax (P1) errors", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "P1", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`bad` should provide correct aggregate info (1 match, 0 exempt, 1 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "info", | ||
description: "Rule bad summary: 1 matches, 0 matches exempt, and 1 errors" | ||
}); | ||
}); | ||
|
||
it("it should error on bad", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "bad", | ||
level: "error" | ||
}); | ||
}); | ||
|
||
it("`ok` should provide correct aggregate info (1 match, 0 exempt, 0 error)", ()=> { | ||
expect({messages}).toContainMessage({ | ||
rule: "ok", | ||
level: "info", | ||
description: "Rule ok summary: 1 matches, 0 matches exempt, and 0 errors" | ||
}); | ||
}); | ||
|
||
it("it should not error on ok", ()=> { | ||
expect({messages}).not.toContainMessage({ | ||
rule: "ok", | ||
level: "error" | ||
}); | ||
}); | ||
}); | ||
}); |
4 changes: 4 additions & 0 deletions
4
__tests__/dummy-projects/29-manifest-loading/yaml-path/lams-manifest.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
rule: | ||
bad: | ||
match: "$" | ||
expr_rule: "false" |
9 changes: 9 additions & 0 deletions
9
__tests__/dummy-projects/29-manifest-loading/yaml-path/manifest.lkml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# LAMS | ||
# rule: ok { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
# } | ||
# rule: bad { | ||
# match: "$" | ||
# expr_rule: true ;; | ||
#} |
Oops, something went wrong.