Skip to content

Commit 355d455

Browse files
committed
Use 'init' instead of '(init)' as the initial module name.
1 parent 1d80f9f commit 355d455

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

PSql.Deploy.Engine.Tests/Seeds/SeedApplicatorTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public SeedApplicatorTests()
2727

2828
_seed = MakeSeed(
2929
"Test",
30-
MakeModule("(init)", ["init-sql"]),
30+
MakeModule("init", ["init-sql"]),
3131
MakeModule("A", ["a-sql"], provides: ["X"]),
3232
MakeModule("B", ["b-sql"], requires: ["X"])
3333
);
@@ -122,9 +122,9 @@ public async Task ApplyAsync_Ok()
122122
ExpectReportStarting();
123123
ExpectConnect();
124124
ExpectPrepare();
125-
ExpectReportApplying("(init)"); ExpectExecuteBatch("init-sql");
126-
ExpectReportApplying("A"); ExpectExecuteBatch("a-sql");
127-
ExpectReportApplying("B"); ExpectExecuteBatch("b-sql");
125+
ExpectReportApplying("init"); ExpectExecuteBatch("init-sql");
126+
ExpectReportApplying("A"); ExpectExecuteBatch("a-sql");
127+
ExpectReportApplying("B"); ExpectExecuteBatch("b-sql");
128128
ExpectReportApplied(count: 3, TargetDisposition.Successful);
129129

130130
await Applicator.ApplyAsync();
@@ -142,7 +142,7 @@ public async Task ApplyAsync_Cycle()
142142
{
143143
_seed = MakeSeed(
144144
"Test",
145-
MakeModule("(init)", ["init-sql"]),
145+
MakeModule("init", ["init-sql"]),
146146
MakeModule("A", ["a-sql"], requires: ["B"]), // \_ cyclic
147147
MakeModule("B", ["b-sql"], requires: ["A"]) // / dependency
148148
);
@@ -168,7 +168,7 @@ public async Task ApplyAsync_UnprovidedTopic()
168168
{
169169
_seed = MakeSeed(
170170
"Test",
171-
MakeModule("(init)", ["init-sql"]),
171+
MakeModule("init", ["init-sql"]),
172172
MakeModule("A", ["a-sql"], requires: ["X"]), // \_ unprovided
173173
MakeModule("B", ["b-sql"], requires: ["X"]) // / topic
174174
);
@@ -216,8 +216,8 @@ public async Task ApplyAsync_Exception()
216216
ExpectReportStarting();
217217
ExpectConnect();
218218
ExpectPrepare();
219-
ExpectReportApplying("(init)"); ExpectExecuteBatch("init-sql");
220-
ExpectReportApplying("A"); ExpectExecuteBatch("a-sql", exception: e);
219+
ExpectReportApplying("init"); ExpectExecuteBatch("init-sql");
220+
ExpectReportApplying("A"); ExpectExecuteBatch("a-sql", exception: e);
221221
ExpectReportProblem("Database is on fire.");
222222
ExpectReportApplied(count: 1, TargetDisposition.Failed);
223223

PSql.Deploy.Engine.Tests/Seeds/SeedLoaderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void Load_Empty()
3030
loadedSeed.Modules.AssignTo(out var modules);
3131

3232
modules .ShouldHaveSingleItem();
33-
modules[0].Name .ShouldBe("(init)");
33+
modules[0].Name .ShouldBe("init");
3434
modules[0].Provides.ShouldBeEmpty();
3535
modules[0].Requires.ShouldBeEmpty();
3636
modules[0].Batches .ShouldBeEmpty();
@@ -48,7 +48,7 @@ public void Load_Typical()
4848

4949
modules.Length .ShouldBe(4);
5050

51-
modules[0].Name .ShouldBe("(init)");
51+
modules[0].Name .ShouldBe("init");
5252
modules[0].WorkerId .ShouldBe(0);
5353
modules[0].Provides .ShouldBeEmpty();
5454
modules[0].Requires .ShouldBeEmpty();
@@ -117,7 +117,7 @@ public void Load_WorkerAll()
117117

118118
modules.Length .ShouldBe(2);
119119

120-
modules[0].Name .ShouldBe("(init)");
120+
modules[0].Name .ShouldBe("init");
121121
modules[0].WorkerId.ShouldBe(0);
122122
modules[0].Provides.ShouldBeEmpty();
123123
modules[0].Requires.ShouldBeEmpty();
@@ -142,7 +142,7 @@ public void Load_WorkerAny()
142142

143143
modules.Length.ShouldBe(1);
144144

145-
modules[0].Name .ShouldBe("(init)");
145+
modules[0].Name .ShouldBe("init");
146146
modules[0].WorkerId .ShouldBe(0);
147147
modules[0].Provides .ShouldBeEmpty();
148148
modules[0].Requires .ShouldBeEmpty();

PSql.Deploy.Engine.Tests/Seeds/SeedSessionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public void ExpectApplyTypicalSeed()
296296
ExpectCreateLog("Typical");
297297
ExpectReportStarting();
298298
ExpectUseConnection();
299-
ExpectReportApplying("(init)");
299+
ExpectReportApplying("init");
300300
ExpectInvokeBatch(TypicalSeed_InitialModule_Batch0);
301301
ExpectReportApplying("init-worker");
302302
ExpectInvokeBatch(TypicalSeed_InitWorkerModule_Batch0);

PSql.Deploy.Engine/Seeds/SeedLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class SeedLoader
2020
private readonly SortedSet<string> _provides;
2121
private readonly SortedSet<string> _requires;
2222

23-
private const string InitialModuleName = "(init)";
23+
private const string InitialModuleName = "init";
2424

2525
private string _moduleName = InitialModuleName;
2626
private bool _allWorkers = false;

0 commit comments

Comments
 (0)