open-policy-agent / opa-idea-plugin

Open Policy Agent plugin for IntelliJ
MIT License
56 stars 22 forks source link

test parser against various policy sources #75

Open vgramer opened 3 years ago

vgramer commented 3 years ago

Description

There is already a lot of tests on the parser but several bugs in the grammar have been found (#74 #67 #64 #59 ). AFAIK there is no way to be sure at 100% that parser is compliant but we can test it against various policy sources to try to find bug

Policy sources:

If you find more relevant sources, please comment on this issue.

TODO

  1. brut force approach, just test the parser against policy to try to find bugs
    • [x] fix #76
    • [x] fix #77
    • [x] fix #78
    • [x] fix #79
  2. improve test suite by adding "cases" that are currently valid for the parser but include in tests
anderseknert commented 3 years ago

Some quirky functions and more here https://github.com/anderseknert/opal :)

vgramer commented 3 years ago

I have tested the parser against the different projects.

Test Results

145 files have been tested. 5 are not compliant with the parser but should be.

open-policy-agent/contrib

Parsing fails on the following files:

open-policy-agent/conftest

Tests Ok

open-policy-agent/gatekeeper-library

Tests Ok

anderseknert/opal

Parsing fails on the following files: