Skip to content

Commit

Permalink
Rename legacy test bundle again
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ronnqvist committed Dec 5, 2024
1 parent 27de70a commit 86ce80f
Show file tree
Hide file tree
Showing 151 changed files with 318 additions and 318 deletions.
8 changes: 4 additions & 4 deletions Tests/SwiftDocCTests/Benchmark/ExternalTopicsHashTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ExternalTopicsGraphHashTests: XCTestCase {

func testNoMetricAddedIfNoExternalTopicsAreResolved() throws {
// Load bundle without using external resolvers
let (_, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (_, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
XCTAssertTrue(context.externallyResolvedLinks.isEmpty)

// Try adding external topics metrics
Expand All @@ -55,7 +55,7 @@ class ExternalTopicsGraphHashTests: XCTestCase {

// Add external links and verify the checksum is always the same
let hashes: [String] = try (0...10).map { _ -> MetricValue? in
let (_, _, context) = try testBundleAndContext(copying: "DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver]) { url in
let (_, _, context) = try testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver]) { url in
try """
# ``SideKit/SideClass``
Expand Down Expand Up @@ -93,7 +93,7 @@ class ExternalTopicsGraphHashTests: XCTestCase {

// Add external links and verify the checksum is always the same
let hashes: [String] = try (0...10).map { _ -> MetricValue? in
let (_, _, context) = try testBundleAndContext(copying: "DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver], externalSymbolResolver: externalSymbolResolver) { url in
let (_, _, context) = try testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver], externalSymbolResolver: externalSymbolResolver) { url in
try """
# ``SideKit/SideClass``
Expand Down Expand Up @@ -131,7 +131,7 @@ class ExternalTopicsGraphHashTests: XCTestCase {
let externalResolver = self.externalResolver

// Load a bundle with external links
let (_, _, context) = try testBundleAndContext(copying: "DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver]) { url in
let (_, _, context) = try testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", externalResolvers: [externalResolver.bundleID: externalResolver]) { url in
try """
# ``SideKit/SideClass``
Expand Down
6 changes: 3 additions & 3 deletions Tests/SwiftDocCTests/Benchmark/TopicGraphHashTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import XCTest
class TopicGraphHashTests: XCTestCase {
func testTopicGraphSameHash() throws {
let hashes: [String] = try (0...10).map { _ -> MetricValue? in
let (_, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (_, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let testBenchmark = Benchmark()
benchmark(add: Benchmark.TopicGraphHash(context: context), benchmarkLog: testBenchmark)
return testBenchmark.metrics[0].result
Expand All @@ -32,7 +32,7 @@ class TopicGraphHashTests: XCTestCase {
func testTopicGraphChangedHash() throws {
// Verify that the hash changes if we change the topic graph
let initialHash: String
let (_, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (_, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")

do {
let testBenchmark = Benchmark()
Expand Down Expand Up @@ -88,7 +88,7 @@ class TopicGraphHashTests: XCTestCase {
"/externally/resolved/path/to/article2": .success(.init(referencePath: "/externally/resolved/path/to/article2")),
]

let (_, bundle, context) = try testBundleAndContext(copying: "DoNotUseInNewTests", externalResolvers: [
let (_, bundle, context) = try testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", externalResolvers: [
"com.external.testbundle" : resolver
]) { url in
// Add external links to the MyKit Topics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import XCTest

class DocumentationContextConverterTests: XCTestCase {
func testRenderNodesAreIdentical() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")

// We'll use this to convert nodes ad-hoc
let perNodeConverter = DocumentationNodeConverter(bundle: bundle, context: context)
Expand All @@ -41,7 +41,7 @@ class DocumentationContextConverterTests: XCTestCase {
}

func testSymbolLocationsAreOnlyIncludedWhenRequested() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)

let fillIntroducedSymbolNode = try XCTUnwrap(
Expand Down Expand Up @@ -71,7 +71,7 @@ class DocumentationContextConverterTests: XCTestCase {
}

func testSymbolAccessLevelsAreOnlyIncludedWhenRequested() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)

let fillIntroducedSymbolNode = try XCTUnwrap(
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftDocCTests/Converter/RenderContextTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import XCTest

class RenderContextTests: XCTestCase {
func testCreatesRenderReferences() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")

let renderContext = RenderContext(documentationContext: context, bundle: bundle)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class TopicRenderReferenceEncoderTests: XCTestCase {
/// Verifies that when JSON encoder should sort keys, the custom render reference cache
/// respects that setting and prints the referencs in alphabetical order.
func testSortedReferences() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let converter = DocumentationNodeConverter(bundle: bundle, context: context)

// Create a JSON encoder
Expand Down Expand Up @@ -218,7 +218,7 @@ class TopicRenderReferenceEncoderTests: XCTestCase {

// Verifies that there is no extra comma at the end of the references list.
func testRemovesLastReferencesListDelimiter() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let converter = DocumentationNodeConverter(bundle: bundle, context: context)

// Create a JSON encoder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class DiagnosticConsoleWriterDefaultFormattingTest: XCTestCase {
let summary = "Test diagnostic summary"
let explanation = "Test diagnostic explanation."
let baseURL = Bundle.module.url(
forResource: "DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
forResource: "LegacyBundle_DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
let source = baseURL.appendingPathComponent("TestTutorial.tutorial")
let range = SourceLocation(line: 44, column: 59, source: source)..<SourceLocation(line: 44, column: 138, source: source)

Expand Down Expand Up @@ -307,7 +307,7 @@ class DiagnosticConsoleWriterDefaultFormattingTest: XCTestCase {
let summary = "Test diagnostic summary"
let explanation = "Test diagnostic explanation."
let baseURL = Bundle.module.url(
forResource: "DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
forResource: "LegacyBundle_DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
let source = baseURL.appendingPathComponent("TestTutorial.tutorial")
let diagnosticRange = SourceLocation(line: 44, column: 59, source: source)..<SourceLocation(line: 44, column: 138, source: source)
let diagnostic = Diagnostic(source: source, severity: .warning, range: diagnosticRange, identifier: identifier, summary: summary, explanation: explanation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ class ConvertServiceTests: XCTestCase {

func testConvertAllPagesForOnDiskContent() throws {
let testBundleURL = Bundle.module.url(
forResource: "DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
forResource: "LegacyBundle_DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!

let request = ConvertRequest(
bundleInfo: testBundleInfo,
Expand Down Expand Up @@ -1444,7 +1444,7 @@ class ConvertServiceTests: XCTestCase {

func testConvertSomeSymbolsAndSomeArticlesForOnDiskContent() throws {
let testBundleURL = Bundle.module.url(
forResource: "DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
forResource: "LegacyBundle_DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!

let request = ConvertRequest(
bundleInfo: testBundleInfo,
Expand All @@ -1468,7 +1468,7 @@ class ConvertServiceTests: XCTestCase {

func testConvertNoSymbolsAndNoArticlesForOnDiskContent() throws {
let testBundleURL = Bundle.module.url(
forResource: "DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!
forResource: "LegacyBundle_DoNotUseInNewTests", withExtension: "docc", subdirectory: "Test Bundles")!

let request = ConvertRequest(
bundleInfo: testBundleInfo,
Expand All @@ -1495,7 +1495,7 @@ class ConvertServiceTests: XCTestCase {
""")
#else
let (testBundleURL, _, _) = try testBundleAndContext(
copying: "DoNotUseInNewTests",
copying: "LegacyBundle_DoNotUseInNewTests",
excludingPaths: [
"sidekit.symbols.json",
"mykit-iOS.symbols.json",
Expand Down Expand Up @@ -1624,7 +1624,7 @@ class ConvertServiceTests: XCTestCase {
""")
#else
let (testBundleURL, _, _) = try testBundleAndContext(
copying: "DoNotUseInNewTests",
copying: "LegacyBundle_DoNotUseInNewTests",
excludingPaths: [
"mykit-iOS.symbols.json",
"[email protected]",
Expand Down
8 changes: 4 additions & 4 deletions Tests/SwiftDocCTests/Indexing/IndexingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class IndexingTests: XCTestCase {

// MARK: - Tutorial
func testTutorial() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let tutorialReference = ResolvedTopicReference(bundleID: "org.swift.docc.example", path: "/tutorials/Test-Bundle/TestTutorial", sourceLanguage: .swift)
let node = try context.entity(with: tutorialReference)
let tutorial = node.semantic as! Tutorial
Expand Down Expand Up @@ -89,7 +89,7 @@ class IndexingTests: XCTestCase {
// MARK: - Article

func testArticle() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let articleReference = ResolvedTopicReference(bundleID: "org.swift.docc.example", path: "/tutorials/Test-Bundle/TestTutorialArticle", sourceLanguage: .swift)
let node = try context.entity(with: articleReference)
let article = node.semantic as! TutorialArticle
Expand Down Expand Up @@ -187,7 +187,7 @@ class IndexingTests: XCTestCase {
}

func testRootPageIndexingRecord() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let articleReference = ResolvedTopicReference(bundleID: "org.swift.docc.example", path: "/documentation/MyKit", sourceLanguage: .swift)
let node = try context.entity(with: articleReference)
let article = node.semantic as! Symbol
Expand All @@ -207,7 +207,7 @@ class IndexingTests: XCTestCase {
}

func testSymbolIndexingRecord() throws {
let (_, bundle, context) = try testBundleAndContext(copying: "DoNotUseInNewTests") { url in
let (_, bundle, context) = try testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests") { url in
// Modify the documentaion to have default availability for MyKit so that there is platform availability
// information for MyProtocol (both in the render node and in the indexing record.
let plistURL = url.appendingPathComponent("Info.plist")
Expand Down
16 changes: 8 additions & 8 deletions Tests/SwiftDocCTests/Indexing/NavigatorIndexTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Root
}

func testNavigatorIndexGeneration() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
var results = Set<String>()
Expand Down Expand Up @@ -895,7 +895,7 @@ Root
}

func testNavigatorIndexUsingPageTitleGeneration() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
var results = Set<String>()
Expand Down Expand Up @@ -944,7 +944,7 @@ Root
}

func testNavigatorIndexGenerationNoPaths() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let converter = DocumentationNodeConverter(bundle: bundle, context: context)
var results = Set<String>()

Expand Down Expand Up @@ -1001,7 +1001,7 @@ Root
}

func testNavigatorIndexGenerationWithLanguageGrouping() throws {
let navigatorIndex = try generatedNavigatorIndex(for: "DoNotUseInNewTests", bundleIdentifier: testBundleIdentifier)
let navigatorIndex = try generatedNavigatorIndex(for: "LegacyBundle_DoNotUseInNewTests", bundleIdentifier: testBundleIdentifier)

XCTAssertEqual(navigatorIndex.availabilityIndex.platforms, [.watchOS, .macCatalyst, .iOS, .tvOS, .macOS, .iPadOS])
XCTAssertEqual(navigatorIndex.availabilityIndex.versions(for: .iOS), Set([
Expand All @@ -1021,7 +1021,7 @@ Root


func testNavigatorIndexGenerationWithCuratedFragment() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)
var results = Set<String>()
Expand Down Expand Up @@ -1084,7 +1084,7 @@ Root
}

func testNavigatorIndexAvailabilityGeneration() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)

Expand Down Expand Up @@ -1214,7 +1214,7 @@ Root
}

func testNavigatorIndexDifferentHasherGeneration() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let renderContext = RenderContext(documentationContext: context, bundle: bundle)
let converter = DocumentationContextConverter(bundle: bundle, context: context, renderContext: renderContext)

Expand Down Expand Up @@ -1663,7 +1663,7 @@ Root
}

func testNavigatorIndexAsReadOnlyFile() throws {
let (bundle, context) = try testBundleAndContext(named: "DoNotUseInNewTests")
let (bundle, context) = try testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
let converter = DocumentationNodeConverter(bundle: bundle, context: context)

let targetURL = try createTemporaryDirectory()
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftDocCTests/Indexing/RenderIndexTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class RenderIndexTests: XCTestCase {
)

try XCTAssertEqual(
generatedRenderIndex(for: "DoNotUseInNewTests", with: "org.swift.docc.example"),
generatedRenderIndex(for: "LegacyBundle_DoNotUseInNewTests", with: "org.swift.docc.example"),
RenderIndex.fromURL(expectedIndexURL)
)
}
Expand Down
Loading

0 comments on commit 86ce80f

Please sign in to comment.