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

feat(e2e): add e2e test for prometheus #942

Merged
merged 16 commits into from Apr 7, 2022
Merged

feat(e2e): add e2e test for prometheus #942

merged 16 commits into from Apr 7, 2022

Conversation

Chever-John
Copy link
Contributor

@Chever-John Chever-John commented Mar 29, 2022

add e2e test for prometheus plugin.
#321
apache/apisix#6276

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2022

Codecov Report

Merging #942 (4c3e6e8) into master (3b99353) will increase coverage by 67.10%.
The diff coverage is n/a.

❗ Current head 4c3e6e8 differs from pull request most recent head b4a8c2b. Consider uploading reports for the commit b4a8c2b to get more accurate results

@@             Coverage Diff              @@
##           master      #942       +/-   ##
============================================
+ Coverage   32.89%   100.00%   +67.10%     
============================================
  Files          72         1       -71     
  Lines        7661         1     -7660     
============================================
- Hits         2520         1     -2519     
+ Misses       4865         0     -4865     
+ Partials      276         0      -276     
Impacted Files Coverage Δ
pkg/api/validation/apisix_consumer.go
pkg/api/validation/apisix_route.go
pkg/api/validation/apisix_tls.go
pkg/api/validation/apisix_upstream.go
pkg/config/config.go
pkg/ingress/apisix_route.go
pkg/ingress/controller.go
pkg/ingress/ingress.go
pkg/kube/translation/apisix_route.go
pkg/kube/translation/ingress.go
... and 63 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3b99353...b4a8c2b. Read the comment docs.

test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/e2e.coverprofile Outdated Show resolved Hide resolved
1. delete e2e.coverprofile;
2. delete prometheus.go;
3. add ApisixRoute into global_rule.go
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
@tao12345666333 tao12345666333 marked this pull request as ready for review April 2, 2022 09:00
test/e2e/features/global_rule.go Outdated Show resolved Hide resolved
@@ -32,7 +32,7 @@ var _ = ginkgo.Describe("server-info plugin", func() {
}
s := scaffold.NewScaffold(opts)

ginkgo.It("enable server-info plugin", func() {
ginkgo.It("enable server-info plugin_", func() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tao12345666333
I have run into an unexpected problem.
I just have modified the e2e test file for "global_rule".
But it transferred the CI error reporting to the "server-info" plugin's e2e test file.

I have just tried as follows.

  1. reinstall docker containers after run
    sudo docker rm $(docker ps -a -q) and
    sudo rmi $(docker images -a) and
    sudo docker volume prune.
  2. and git reset to the version that we did not change the apisix-alpine(version is reseted to 2.12). There still be problem.
  3. The error message is expect is True, actual is false. (Sry, forgive me have delete all data and do not copy the former error message.

I am looking forward to hear from you!

Copy link
Member

Choose a reason for hiding this comment

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

@Chever-John you can just ignore this or disable server-info plugin test case.

In APISIX v2.13 this plugin is disabled by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clear!

@@ -32,13 +32,13 @@ var _ = ginkgo.Describe("server-info plugin", func() {
}
s := scaffold.NewScaffold(opts)

ginkgo.It("enable server-info plugin", func() {
ginkgo.It("disable server-info plugin", func() {
Copy link
Member

Choose a reason for hiding this comment

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

There is no need to adjust the content of the test case, just Skip() the test case directly

Copy link
Member

@tao12345666333 tao12345666333 left a comment

Choose a reason for hiding this comment

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

LGTM.

Let's move forward.

@tao12345666333
Copy link
Member

@Chever-John Could you please create another PR to fix the test case of the server-info plugin

@@ -56,6 +59,30 @@ spec:
// Wait until the ApisixClusterConfig create event was delivered.
time.Sleep(3 * time.Second)

ar := fmt.Sprintf(`
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's worthy to write some documents about "How to access Apache APISIX Prometheus Metrics on Kubernetes".

Copy link
Member

Choose a reason for hiding this comment

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

There seems to be a similar article on APISIX's WeChat account

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we also file them?

Copy link
Member

Choose a reason for hiding this comment

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

Could we also file them?

Yes, but I don't think it has much to do with this PR, I want to merge this PR first. @tokers

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, let's do it in another PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

See #953.

@tao12345666333 tao12345666333 merged commit de33d05 into apache:master Apr 7, 2022
@tao12345666333 tao12345666333 mentioned this pull request Apr 7, 2022
4 tasks
fgksgf pushed a commit to fgksgf/apisix-ingress-controller that referenced this pull request Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants