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

[YUNIKORN-1649] Use Junit reporter in all suites #561

Closed
wants to merge 6 commits into from

Conversation

wusamzong
Copy link
Contributor

What is this PR for?

Using Junit in all test suites.
Create a conditional statement to exclude the case that the test directory(/tmp/e2e-test-reports) has been created by make e2e_test

What type of PR is it?

  • - Sub-task

What is the Jira issue?

How should this be tested?

Screenshots (if appropriate)

Questions:

  • - The licenses files need update.
  • - There is breaking changes for older versions.
  • - It needs documentation.

@wilfred-s
Copy link
Contributor

wait with kicking off the workflow until YUNIKORN-1666 is fixed

Copy link
Contributor

@pbacsko pbacsko left a comment

Choose a reason for hiding this comment

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

Some copy-paste issues.

Also, pls check the naming of the xml files for consistency, other suites use names like "TEST-resourcefairness.xml", "TEST-bin_packing_junit.xml", but not every suite follows this. This could potentially be addressed in a follow-up JIRA.

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #561 (f2d32d2) into master (a28e01d) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #561      +/-   ##
==========================================
- Coverage   69.97%   69.93%   -0.05%     
==========================================
  Files          46       47       +1     
  Lines        7881     7925      +44     
==========================================
+ Hits         5515     5542      +27     
- Misses       2163     2176      +13     
- Partials      203      207       +4     

see 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@manirajv06 manirajv06 left a comment

Choose a reason for hiding this comment

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

@wusamzong Please address the comments raised by @pbacsko. Every test suite should have appropriate names (in 2 places).

Also, other scope of this jira is to explore "Does Junit reporter library itself provide any options to create the directory if it doesn't exists?". This helps to avoid creating directory in Makefile. Having hard coded directory name itself in Makefile is error prone. So we need to see if there is a way to avoid it.

Copy link
Contributor

@HuangTing-Yao HuangTing-Yao left a comment

Choose a reason for hiding this comment

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

@wusamzong Please address the comments above, the other parts is ok to me.

@wusamzong
Copy link
Contributor Author

@pbacsko , @manirajv06 , @HuangTing-Yao Thanks for your review! I will make the change.

@wusamzong
Copy link
Contributor Author

The Ginkgo file only mentions creating a temporary directory.
Therefore, I created a function to create a Junit directory in common.util, so that the directory can be guaranteed to be created before each report is generated. Wondering if this is appropriate?

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

Some naming issues, otherwise looks ok.

test/e2e/predicates/predicates_suite_test.go Show resolved Hide resolved
report,
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "QueueQuotaMgmt_junit.xml"),
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "TEST-QueueQuotaMgmt_junit.xml"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be TEST-queue_quota_mgmt_junit.xml

@@ -52,7 +52,9 @@ var _ = AfterSuite(func() {

func TestResourceFairness(t *testing.T) {
ginkgo.ReportAfterSuite("Resource Fairness", func(report ginkgo.Report) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be TestResourceFairness.

err := reporters.GenerateJUnitReportWithConfig(
err := common.CreateJUnitReportDir()
Ω(err).NotTo(gomega.HaveOccurred())
err = reporters.GenerateJUnitReportWithConfig(
report,
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "TEST-resourcefairness.xml"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be TEST-resource_fairness_junit.xml.

err := reporters.GenerateJUnitReportWithConfig(
err := common.CreateJUnitReportDir()
Ω(err).NotTo(gomega.HaveOccurred())
err = reporters.GenerateJUnitReportWithConfig(
report,
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "TEST-SparkJobs_junit.xml"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be TEST-spark_jobs_junit.xml.

report,
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "StateAwareAppScheduling_junit.xml"),
filepath.Join(configmanager.YuniKornTestConfig.LogDir, "TEST-StateAwareAppScheduling_junit.xml"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be TEST-stateaware_app_scheduling_junit.xml.

@@ -52,9 +52,11 @@ var _ = AfterSuite(func() {

func TestStateAwareAppScheduling(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Method should be named TestQueueQuotaMgmt.

@wusamzong
Copy link
Contributor Author

@craigcondit Thanks for your review! I solved the name issues you mentioned

Copy link
Contributor

@craigcondit craigcondit left a comment

Choose a reason for hiding this comment

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

+1 LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants