Test attribute dependsOnMethods not honored when running tests individually

Đang mở
#1,672 2 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
java, typescript, vscode

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện một phương thức TestNG được chạy riêng lẻ với quan hệ dependsOnMethods trong VS Code Java Test extension, sau đó lần theo việc lựa chọn qua TestNGRunner và TestNGLauncher đến lỗi của MethodHelper. Hoàn tất khi phương thức được chọn chạy dependency của nó trước, thay vì báo rằng dependency không được bao gồm.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ai-triaged enhancement test-execution testng

In eclipse, when you run a test individually and it depends on another test, it runs that other test first and then runs the test that has the dependency.
With the VSCode plugin, it does not appear to do this successfully. Instead it fails to find the dependency method:

[ INFO ] 2024-03-15 08:28:14.586 DefaultTestContextBootstrapper:174 - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@25e2ab5a, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@35e5d0e5, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@73173f63, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@55562aa9, org.springframework.test.context.support.DirtiesContextTestExecutionListener@655ef322, org.springframework.test.context.event.EventPublishingTestExecutionListener@7e276594] Exception occured while running tests. org.testng.TestNGException: com.oreilly.yeti.tests.shippingServiceTest.organizationControllerTest.OrganizationControllerPositiveTest.getOrganizationById_expect_200() is depending on method public void com.oreilly.yeti.tests.shippingServiceTest.organizationControllerTest.OrganizationControllerPositiveTest.getOrganization_allOrgs_expect_200(), which is not annotated with @Test or not included. at org.testng.internal.MethodHelper.findDependedUponMethods(MethodHelper.java:141) MethodHelper.java:141 at org.testng.internal.MethodHelper.topologicalSort(MethodHelper.java:284) MethodHelper.java:284 at org.testng.internal.MethodHelper.sortMethods(MethodHelper.java:382) MethodHelper.java:382 at org.testng.internal.MethodHelper.lambda$collectAndOrderMethods$1(MethodHelper.java:75) MethodHelper.java:75 at org.testng.util.TimeUtils.computeAndShowTime(TimeUtils.java:45) TimeUtils.java:45 at org.testng.internal.MethodHelper.collectAndOrderMethods(MethodHelper.java:71) MethodHelper.java:71 at org.testng.TestRunner.computeAndGetAllTestMethods(TestRunner.java:557) TestRunner.java:557 at org.testng.internal.TestMethodContainer.getItems(TestMethodContainer.java:32) TestMethodContainer.java:32 at org.testng.internal.TestMethodContainer.getItems(TestMethodContainer.java:14) TestMethodContainer.java:14 at org.testng.TestRunner.initMethods(TestRunner.java:526) TestRunner.java:526 at org.testng.TestRunner.init(TestRunner.java:335) TestRunner.java:335 at org.testng.TestRunner.init(TestRunner.java:288) TestRunner.java:288 at org.testng.TestRunner.<init>(TestRunner.java:178) TestRunner.java:178 at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:639) SuiteRunner.java:639 at org.testng.SuiteRunner.init(SuiteRunner.java:225) SuiteRunner.java:225 at org.testng.SuiteRunner.<init>(SuiteRunner.java:115) SuiteRunner.java:115 at org.testng.TestNG.createSuiteRunner(TestNG.java:1349) TestNG.java:1349 at org.testng.TestNG.createSuiteRunners(TestNG.java:1325) TestNG.java:1325 at org.testng.TestNG.runSuitesLocally(TestNG.java:1167) TestNG.java:1167 at org.testng.TestNG.runSuites(TestNG.java:1099) TestNG.java:1099 at org.testng.TestNG.run(TestNG.java:1067) TestNG.java:1067 at com.microsoft.java.test.runner.testng.TestNGRunner.run(TestNGRunner.java:45) at com.microsoft.java.test.runner.testng.TestNGLauncher.execute(TestNGLauncher.java:32) at com.microsoft.java.test.runner.Launcher.main(Launcher.java:57)

  • It would be nice to just be able to click and run single methods that have dependencies instead of having to run the whole test class.
Ngôn ngữ chính
TypeScript
Star
340
Fork
173
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
18

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/vscode-java-test

Tất cả issue của microsoft/vscode-java-test

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.