Skip to content

Commit 4f1c145

Browse files
committed
FileConventions.Test: test for new functionality
Added test for detecting inconsistent versions in Github workflow files with values in global environment dictionary. Contains failing test.
1 parent f815f61 commit 4f1c145

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
jobA:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Setup Pulumi CLI
11+
uses: pulumi/[email protected]
12+
with:
13+
pulumi-version: ${{ env.PULUMI_VERSION }}
14+
- name: Print "Hello World!"
15+
run: echo "Hello World!"
16+
jobB:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Setup Pulumi CLI
21+
uses: pulumi/[email protected]
22+
with:
23+
pulumi-version: 3.40.0
24+
- name: Print "Hello World!"
25+
run: echo "Hello World!"

src/FileConventions.Test/FileConventions.Test.fs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,25 @@ let DetectInconsistentVersionsInGitHubCIWorkflow7() =
410410
Is.EqualTo true
411411
)
412412

413+
[<Test>]
414+
let DetectInconsistentVersionsInGitHubCIWorkflow8() =
415+
let fileInfo =
416+
(Seq.singleton(
417+
FileInfo(
418+
Path.Combine(
419+
dummyFilesDirectory.FullName,
420+
"DummyCIWithSameSetupPulumiVersionInEnv.yml"
421+
)
422+
)
423+
))
424+
425+
let envDict = Map.ofList [ "PULUMI_VERSION", "3.40.0" ]
426+
427+
Assert.That(
428+
DetectInconsistentVersionsInGitHubCIWorkflow fileInfo envDict,
429+
Is.EqualTo false
430+
)
431+
413432

414433
[<Test>]
415434
let DetectInconsistentVersionsInGitHubCI1() =

src/FileConventions.Test/FileConventions.Test.fsproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848
<None Include="DummyFiles\DummyCIWithSameSetupPulumiVersion.yml" />
4949
<None Include="DummyFiles\DummyCIWithSetupPulumiVersionV2.0.0.yml" />
5050
<None Include="DummyFiles\DummyCIWithSetupPulumiVersionV2.0.1.yml" />
51+
<None Include="DummyFiles\DummyCIWithSameSetupPulumiVersionInEnv.yml" />
5152
</ItemGroup>
5253
</Project>

0 commit comments

Comments
 (0)