Skip to content

Add a request to list all the tests within a workspace or document #978

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

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Nov 23, 2023

Requires swiftlang/indexstore-db#175


Fixes #611
rdar://98710526

@ahoppen
Copy link
Member Author

ahoppen commented Nov 23, 2023

@swift-ci Please test

@ahoppen ahoppen marked this pull request as draft November 24, 2023 01:55
@ahoppen
Copy link
Member Author

ahoppen commented Nov 24, 2023

A couple things I didn’t consider in the initial draft:

  • I think I didn’t include transitive subclasses of XCTest
  • I also included test methods that had parameters
  • Apparently, things work completely differently on Linux and Windows and subclasses of XCTestCase aren’t actually modeled as such in the index. Still need to investigate this one.

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Cool!

@grynspan
Copy link

Does this work with swift-testing too?

guard let index = workspace.index else {
return []
}
let xctestSubclasses = index.occurrences(ofUSR: "c:objc(cs)XCTest", roles: [.baseOf])

Choose a reason for hiding this comment

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

The superclass to look for is named "XCTestCase". The class named plain "XCTest" is its superclass, but it's abstract and we only search for subclasses of the former.

@ahoppen
Copy link
Member Author

ahoppen commented Nov 29, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch from 2b454d3 to be3ffcd Compare November 30, 2023 17:54
@ahoppen
Copy link
Member Author

ahoppen commented Nov 30, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Nov 30, 2023

swiftlang/indexstore-db#175

@swift-ci Please test Windows

@ahoppen ahoppen changed the title Add a request to list all the tests within the current workspace Add a request to list all the tests within a workspace or document Nov 30, 2023
@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch from be3ffcd to 827fad0 Compare December 4, 2023 23:53
@ahoppen
Copy link
Member Author

ahoppen commented Dec 4, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch from 827fad0 to 1b772ea Compare December 5, 2023 18:02
@ahoppen
Copy link
Member Author

ahoppen commented Dec 5, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch 2 times, most recently from 4bb2cde to 66b8d42 Compare December 6, 2023 00:23
@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2023

swiftlang/indexstore-db#175

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch from 66b8d42 to 059782b Compare December 6, 2023 22:24
@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2023

swiftlang/indexstore-db#175

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 6, 2023

swiftlang/indexstore-db#175

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the ahoppen/workspace-tests branch from 059782b to 96905aa Compare December 7, 2023 01:40
@ahoppen
Copy link
Member Author

ahoppen commented Dec 7, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Dec 7, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit c71ab1a into swiftlang:main Dec 7, 2023
@ahoppen ahoppen deleted the ahoppen/workspace-tests branch December 7, 2023 17:43
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.

Add custom request to return a list of all the tests in a project with locations
4 participants