Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update corpus tests #12

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Update corpus tests #12

merged 2 commits into from
Nov 6, 2024

Conversation

shaobo-he-aws
Copy link
Contributor

@shaobo-he-aws shaobo-he-aws commented Nov 6, 2024

Description of changes:

These tests should include entity tags.

Signed-off-by: Shaobo He <[email protected]>
Signed-off-by: Shaobo He <[email protected]>
@john-h-kastner-aws
Copy link

Should we be concerned about the size of the corpus tests tar shrinking by -732 KB (72%)?

@cdisselkoen
Copy link

Per John's comment, we could run the script authored by @khieta to analyze the differences between the corpus tests. It's in the scripts/ directory in this repo.

@john-h-kastner-aws
Copy link

Looks like they're run in CI:

Run python3 scripts/get_corpus_stats.py corpus-tests.tar.gz
Extracting corpus-tests.tar.gz
Generating report

|                                  |                              |
|----------------------------------|------------------------------|
| Total test cases                 | 5130                         |
| Unique policies                  | 2802 ( 54.6% )               |
| Unique schemas                   | 1829 ( 35.7% )               |
| Unique entity stores             | 2460 ( 48.0% )               |
| Entities per entity store        | mean: 1 / median: 1 / p90: 3 |
| Schema entity types              | mean: 1 / median: 1 / p90: 2 |
| Schema actions                   | mean: 1 / median: 1 / p90: 1 |
| Trivial policies                 | 2059 ( 40.1% )               |
| Pure RBAC (non-trivial) policies | 714 ( 13.9% )                |
| Pure ABAC (non-trivial) policies | 102 ( 2.0% )                 |
Run python3 scripts/get_corpus_stats.py corpus-tests.tar.gz --original ../old-corpus/corpus-tests.tar.gz
Extracting corpus-tests.tar.gz
Extracting ../old-corpus/corpus-tests.tar.gz
Generating report

|                                  | Original                     | New                          | Difference   |
|----------------------------------|------------------------------|------------------------------|--------------|
| Total test cases                 | 5096                         | 5130                         | 34           |
| Unique policies                  | 2605 ( 51.1% )               | 2802 ( 54.6% )               | 197          |
| Unique schemas                   | 2131 ( 41.8% )               | 1829 ( 35.7% )               | -302         |
| Unique entity stores             | 2970 ( 58.3% )               | 2460 ( 48.0% )               | -510         |
| Entities per entity store        | mean: 1 / median: 1 / p90: 6 | mean: 1 / median: 1 / p90: 3 | n/a          |
| Schema entity types              | mean: 1 / median: 1 / p90: 5 | mean: 1 / median: 1 / p90: 2 | n/a          |
| Schema actions                   | mean: 1 / median: 1 / p90: 1 | mean: 1 / median: 1 / p90: 1 | n/a          |
| Trivial policies                 | 2293 ( 45.0% )               | 2059 ( 40.1% )               | -234         |
| Pure RBAC (non-trivial) policies | 693 ( 13.6% )                | 714 ( 13.9% )                | 21           |
| Pure ABAC (non-trivial) policies | 90 ( 1.8% )                  | 102 ( 2.0% )                 | 12           |

Copy link

@john-h-kastner-aws john-h-kastner-aws left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on comparison script output, I'm not concerned about the decrease in compressed corpus size

@shaobo-he-aws shaobo-he-aws merged commit 8649d45 into main Nov 6, 2024
5 checks passed
@shaobo-he-aws shaobo-he-aws deleted the chore/shaobo/update-tests branch November 6, 2024 17:20
shaobo-he-aws added a commit that referenced this pull request Nov 6, 2024
* Update corpus tests (#12)

* Update corpus tests

Signed-off-by: Shaobo He <[email protected]>

* use gzip...

Signed-off-by: Shaobo He <[email protected]>

---------

Signed-off-by: Shaobo He <[email protected]>

* update commits

Signed-off-by: Shaobo He <[email protected]>

---------

Signed-off-by: Shaobo He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants