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

Verify corectness of template tests #85

Closed
RedXanadu opened this issue Apr 24, 2023 · 3 comments · Fixed by #86
Closed

Verify corectness of template tests #85

RedXanadu opened this issue Apr 24, 2023 · 3 comments · Fixed by #86
Assignees

Comments

@RedXanadu
Copy link
Member

RedXanadu commented Apr 24, 2023

Every time that I copy-paste one of the agreed 'example tests' from the Contribution Guidelines document, my PR gets errors.

We need to verify that the template "gold standard" tests are correct.

Link to the test templates: https://github.com/coreruleset/documentation/blob/main/content/development/contribution_guidelines.md#positive-tests

@RedXanadu
Copy link
Member Author

RedXanadu commented Apr 24, 2023

I believe that the user agent needs to be changed to:

User-Agent: "OWASP CRS test agent"

Was this modified at some point but the documentation didn't get updated?


Also, it looks like the linter is unhappy for some reason with Accept headers, and they now require double-quote marks to work, so they need to be:

Accept: "*/*"

Although I note that the current example tests work fine in Go-FTW, no quote marks needed. Just the linter is unhappy for some reason.


@fzipi, you're probably the best source of knowledge on how testing works. Can you confirm please that these changes are correct? We need to ensure that the template tests we provide are correct.

@dune73
Copy link
Member

dune73 commented Apr 26, 2023

I confirm on the UA change.

Accept: Interesting. Funny thing is we use a crazy long Accept header for almost all existing tests. I would not mind cleaning this up to something much simpler.

@theseion theseion self-assigned this May 1, 2023
@theseion
Copy link
Contributor

theseion commented May 2, 2023

The Accept header thing is probably just because * is a special token in YAML.

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 a pull request may close this issue.

3 participants