Skip to content

Commit 4e16d2f

Browse files
committed
fix bootstrapping of ported assembly tests
1 parent 9b5bd6e commit 4e16d2f

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

tests-integration/Elastic.Assembler.IntegrationTests/AssemblerConfigurationTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ public PublicOnlyAssemblerConfigurationTests()
3535
public void ReadsPrivateRepositories()
3636
{
3737
var config = Context.Configuration;
38-
#pragma warning disable IDE0058
3938
config.ReferenceRepositories.Should().NotBeEmpty().And.NotContainKey("cloud");
40-
#pragma warning restore IDE0058
4139
config.PrivateRepositories.Should().NotBeEmpty().And.ContainKey("cloud");
4240
var cloud = config.PrivateRepositories["cloud"];
4341
cloud.Should().NotBeNull();
@@ -120,8 +118,8 @@ public void ReadsVersions()
120118
beats.GitReferenceCurrent.Should().NotBeNullOrEmpty()
121119
.And.NotBe("main");
122120

123-
var cloud = config.ReferenceRepositories["cloud"];
124-
cloud.GitReferenceCurrent.Should().NotBeNullOrEmpty()
121+
var curator = config.ReferenceRepositories["curator"];
122+
curator.GitReferenceCurrent.Should().NotBeNullOrEmpty()
125123
.And.Be("master");
126124
}
127125

tests-integration/Elastic.Assembler.IntegrationTests/GlobalNavigationTests.cs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,31 @@ public GlobalNavigationPathProviderTests(DocumentationFixture fixture, ITestOutp
4747
Context = new AssembleContext(config, configurationContext, "dev", Collector, FileSystem, FileSystem, CheckoutDirectory.FullName, null);
4848
}
4949

50-
private Checkout CreateCheckout(IFileSystem fs, string name) =>
51-
new()
50+
private Checkout CreateCheckout(IFileSystem fs, Repository repository)
51+
{
52+
var name = repository.Name;
53+
var path = repository.Path is { } p
54+
? fs.DirectoryInfo.New(p)
55+
: fs.DirectoryInfo.New(fs.Path.Combine(Path.Combine(CheckoutDirectory.FullName, name)));
56+
return new Checkout
5257
{
5358
Repository = new Repository
5459
{
5560
Name = name,
5661
Origin = $"elastic/{name}"
5762
},
5863
HeadReference = Guid.NewGuid().ToString(),
59-
Directory = fs.DirectoryInfo.New(fs.Path.Combine(Path.Combine(CheckoutDirectory.FullName, name)))
64+
Directory = path
6065
};
66+
}
6167

6268
private async Task<AssembleSources> Setup()
6369
{
6470
_ = Collector.StartAsync(TestContext.Current.CancellationToken);
6571

66-
string[] nar = [NarrativeRepository.RepositoryName];
67-
var repos = nar.Concat(Context.Configuration.AvailableRepositories
68-
.Where(kv => !kv.Value.Skip)
69-
.Where(kv => !kv.Value.Private)
70-
.Select(kv => kv.Value.Name)
71-
)
72+
var repos = Context.Configuration.AvailableRepositories
73+
.Where(kv => !kv.Value.Skip)
74+
.Select(kv => kv.Value)
7275
.ToArray();
7376
var checkouts = repos.Select(r => CreateCheckout(FileSystem, r)).ToArray();
7477
var configurationContext = TestHelpers.CreateConfigurationContext(new FileSystem());
@@ -198,7 +201,7 @@ public async Task ParsesGlobalNavigation()
198201
assembleSources.NavigationTocMappings[kibanaExtendMoniker].TopLevelSource.Should().Be(expectedRoot);
199202
assembleSources.NavigationTocMappings.Should().NotBeEmpty().And.ContainKey(new Uri("docs-content://reference/apm/"));
200203

201-
var uri = new Uri("integrations://reference/");
204+
var uri = new Uri("integrations://extend");
202205
assembleSources.TreeCollector.Should().NotBeNull();
203206
_ = assembleSources.TreeCollector.TryGetTableOfContentsTree(uri, out var tree);
204207
tree.Should().NotBeNull();
@@ -277,10 +280,9 @@ public async Task UriResolving()
277280
var configurationContext = TestHelpers.CreateConfigurationContext(fs);
278281
var config = AssemblyConfiguration.Create(configurationContext.ConfigurationFileProvider);
279282
var assembleContext = new AssembleContext(config, configurationContext, "prod", collector, fs, fs, null, null);
280-
var repos = assembleContext.Configuration.ReferenceRepositories
283+
var repos = assembleContext.Configuration.AvailableRepositories
281284
.Where(kv => !kv.Value.Skip)
282-
.Select(kv => kv.Value.Name)
283-
.Concat([NarrativeRepository.RepositoryName])
285+
.Select(kv => kv.Value)
284286
.ToArray();
285287
var checkouts = repos.Select(r => CreateCheckout(fs, r)).ToArray();
286288
var assembleSources = await AssembleSources.AssembleAsync(

0 commit comments

Comments
 (0)