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

[WIP] Improves e2e test, adds mod files for standalone run #822

Closed
wants to merge 8 commits into from

Conversation

M4tteoP
Copy link
Member

@M4tteoP M4tteoP commented Jun 21, 2023

Work in progress:
The following command is now running:

go run github.com/corazawaf/coraza/v3/http/e2e --proxy-hostport localhost:8080 --httpbin-hostport localhost:8081

But go mod tidy run under testing/e2e/ submodule is failing, even if the test itself is working:

▶ go mod tidy
go: finding module for package github.com/corazawaf/coraza/v3/http/e2e/runner
github.com/corazawaf/coraza/v3/testing/e2e tested by
	github.com/corazawaf/coraza/v3/testing/e2e.test imports
	github.com/corazawaf/coraza/v3/http/e2e/runner: module github.com/corazawaf/coraza/v3@latest found (v3.0.0), but does not contain package github.com/corazawaf/coraza/v3/http/e2e/runner
▶ go test -run ^TestE2e$ github.com/corazawaf/coraza/v3/testing/e2e
ok  	github.com/corazawaf/coraza/v3/testing/e2e	3.933s

@jcchavezs
Copy link
Member

Do you mind rebasing this PR @M4tteoP ?

@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.41 🎉

Comparison is base (cc4ec80) 81.57% compared to head (0c769c3) 81.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #822      +/-   ##
==========================================
+ Coverage   81.57%   81.98%   +0.41%     
==========================================
  Files         158      156       -2     
  Lines        8959     8711     -248     
==========================================
- Hits         7308     7142     -166     
+ Misses       1406     1339      -67     
+ Partials      245      230      -15     
Flag Coverage Δ
default 76.67% <ø> (+0.10%) ⬆️
examples 25.66% <ø> (ø)
ftw 47.11% <ø> (ø)
ftw-multiphase 49.25% <ø> (ø)
tinygo 74.85% <ø> (+2.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

magefile.go Outdated Show resolved Hide resolved
rsc.io/binaryregexp v0.2.0 // indirect
)

replace github.com/corazawaf/coraza/v3/http/e2e => ../../http/e2e/
Copy link
Member Author

Choose a reason for hiding this comment

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

I had to add it because actually the /coraza/v3/http/e2e/runner package is not just inside the remote coraza/v3.
What is strange is that, removing the replace and updating coraza to v3.0.2 inside this submodule it ends up with ambiguous import: found package github.com/corazawaf/coraza/v3/testing/e2e in multiple modules

@jcchavezs jcchavezs mentioned this pull request Jul 11, 2023
4 tasks
@M4tteoP
Copy link
Member Author

M4tteoP commented Jul 11, 2023

Superseded by #841, thanks @jcchavezs 🙇‍♂️

@M4tteoP M4tteoP closed this Jul 11, 2023
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.

2 participants