Skip to content

Commit 1b057d5

Browse files
Fix Fatal (#16)
Fixes #15
1 parent ba38043 commit 1b057d5

File tree

7 files changed

+49
-94
lines changed

7 files changed

+49
-94
lines changed

.github/workflows/CI.yaml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,10 @@
11
name: CI
22
on:
3-
push:
4-
branches:
5-
- main
63
pull_request:
74
workflow_dispatch:
85
permissions:
96
checks: write
107
pull-requests: write
118
jobs:
12-
test:
13-
name: Run Tests
14-
runs-on: ${{ matrix.os }}
15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
os: [ubuntu-latest, windows-latest, macOS-latest]
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Install and cache PowerShell modules
22-
id: psmodulecache
23-
uses: potatoqualitee/[email protected]
24-
with:
25-
modules-to-cache: Pester:5.3.3, psake:4.9.0, BuildHelpers:2.0.16, PowerShellBuild:0.6.1, PSScriptAnalyzer:1.19.1
26-
shell: pwsh
27-
- name: Test
28-
shell: pwsh
29-
run: ./build.ps1 -Task Test -Bootstrap
30-
- name: Upload Unit Test Results
31-
if: always()
32-
uses: actions/upload-artifact@v2
33-
with:
34-
name: Unit Test Results (OS ${{ matrix.os }})
35-
path: ./tests/out/testResults.xml
36-
publish-test-results:
37-
name: "Publish Unit Tests Results"
38-
needs: test
39-
runs-on: ubuntu-latest
40-
# the test job might be skipped, we don't need to run this job then
41-
if: success() || failure()
42-
43-
steps:
44-
- name: Download Artifacts
45-
uses: actions/download-artifact@v2
46-
with:
47-
path: artifacts
48-
49-
- name: Publish Unit Test Results
50-
uses: EnricoMi/publish-unit-test-result-action@v2
51-
with:
52-
files: artifacts/**/*.xml
9+
ci:
10+
uses: HeyItsGilbert/.github/.github/workflows/ModuleCI.yml@main

.github/workflows/publish.yaml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,6 @@ on:
55
- main
66
workflow_dispatch:
77
jobs:
8-
publish:
9-
runs-on: windows-latest
10-
steps:
11-
# Get the current version
12-
- uses: actions/checkout@v3
13-
- name: Install and cache PowerShell modules
14-
id: psmodulecache
15-
uses: potatoqualitee/[email protected]
16-
with:
17-
modules-to-cache: BuildHelpers
18-
- shell: pwsh
19-
# Give an id to the step, so we can reference it later
20-
id: check_if_versions_bumped
21-
run: |
22-
[version]$GalleryVersion = Get-NextNugetPackageVersion -Name ChocoLogParse -ErrorAction Stop
23-
[version]$GithubVersion = Get-MetaData -Path ./ChocoLogParse/ChocoLogParse.psd1 -PropertyName ModuleVersion -ErrorAction Stop
24-
$bumped = $GithubVersion -ge $GalleryVersion
25-
26-
# Set the output named "version_bumped"
27-
Write-Host "::set-output name=version_bumped::$bumped"
28-
29-
- name: Publish to PSGallery
30-
shell: pwsh
31-
if: steps.check_if_versions_bumped.outputs.version_bumped == 'True'
32-
env:
33-
PSGALLERY_API_KEY: ${{ secrets.PS_GALLERY_KEY }}
34-
run: ./build.ps1 -Task Publish -Bootstrap
8+
build:
9+
uses: HeyItsGilbert/.github/.github/workflows/PublishModule.yml@main
10+
secrets: inherit

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [1.0.1] Add Missing Fatal
9+
10+
### Fixes
11+
12+
- Adds missing FATAL from log type by bumping Log4NetParse to 1.1.2.
13+
814
## [1.0.0] Handle Logs with Out of Order Threads
915

1016
### Added

ChocoLogParse/ChocoLogParse.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'ChocoLogParse.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.0'
15+
ModuleVersion = '1.0.1'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -51,7 +51,7 @@
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = "Log4NetParse"; ModuleVersion = "1.1.1"; })
54+
RequiredModules = @(@{ModuleName = "Log4NetParse"; ModuleVersion = "1.1.2"; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
# RequiredAssemblies = @()

cspell.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2",
3+
"ignorePaths": [],
4+
"dictionaryDefinitions": [],
5+
"dictionaries": [
6+
"powershell"
7+
],
8+
"words": [],
9+
"ignoreWords": [
10+
"choco",
11+
"psake"
12+
],
13+
"import": []
14+
}

requirements.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
Version = '1.19.1'
2222
}
2323
'Log4NetParse' = @{
24-
Version = '1.1.1'
24+
Version = '1.1.2'
2525
}
2626
}

tests/ChocoLogParse.tests.ps1

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# cSpell:ignore BHPS Ffoo Subkeys
12
BeforeDiscovery {
23
$manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest
34
$outputDir = Join-Path -Path $env:BHProjectPath -ChildPath 'Output'
@@ -98,88 +99,88 @@ Chocolatey upgraded 0/1 packages.
9899

99100
Describe 'Read-ChocoLog' {
100101
BeforeAll {
101-
$parsed = Read-ChocoLog -Path $singleFile
102-
$multiple = Read-ChocoLog -Path $folder
103-
$moreLimit = Read-ChocoLog -Path $folder -FileLimit 10
102+
$script:parsed = Read-ChocoLog -Path $singleFile
103+
$script:multiple = Read-ChocoLog -Path $folder
104+
$script:moreLimit = Read-ChocoLog -Path $folder -FileLimit 10
104105
}
105106

106107
Context 'For Single File' {
107108
It 'Parses the correct number of sessions' {
108-
($parsed).Count | Should -Be 3
109+
($script:parsed).Count | Should -Be 3
109110
}
110111

111112
It 'Parses the correct number of lines per session' {
112-
$parsed[1].logs.Count | Should -Be 10
113+
$script:parsed[1].logs.Count | Should -Be 10
113114
}
114115

115116
It 'Detects the exit code' {
116-
$parsed[1].exitCode | Should -Be 100
117+
$script:parsed[1].exitCode | Should -Be 100
117118
}
118119

119120
It 'Detects the right session number' {
120-
$parsed[1].thread | Should -Be 57332
121+
$script:parsed[1].thread | Should -Be 57332
121122
}
122123

123124
It 'Has Configuration with Subkeys' {
124-
$parsed[1].Configuration['Features']['UsePackageExitCodes'] | Should -Be 'True'
125+
$script:parsed[1].Configuration['Features']['UsePackageExitCodes'] | Should -Be 'True'
125126
}
126127
}
127128

128129
Context 'For Folder Path' {
129130
It 'Parses the correct default number of sessions' {
130131
# There is two sessions in each file and we grab one file by default
131132
# 1 for $randID and 1 for $randID2
132-
($multiple).Count | Should -Be 2
133+
($script:multiple).Count | Should -Be 2
133134
}
134135

135136
It 'Parses the correct number of sessions for increased limit' {
136137
# There is one session in each file so there should be a total of 10
137138
# 5 for $randID and 5 for $randID2
138-
($moreLimit).Count | Should -Be 20
139+
($script:moreLimit).Count | Should -Be 20
139140
}
140141

141142
It 'Parses the correct number of lines per session' {
142-
$multiple[0].logs.Count | Should -Be 9
143+
$script:multiple[0].logs.Count | Should -Be 9
143144
}
144145
}
145146
}
146147

147148
Describe 'Get-ChocoLogEntry' {
148149
BeforeAll {
149-
$parsedEntry = Get-ChocoLogEntry -Path $singleFile
150-
$multipleEntry = Get-ChocoLogEntry -Path $folder
150+
$script:parsedEntry = Get-ChocoLogEntry -Path $singleFile
151+
$script:multipleEntry = Get-ChocoLogEntry -Path $folder
151152
}
152153

153154
Context 'For Single File' {
154155
It 'Parses the correct number of sessions' {
155-
($parsedEntry).Count | Should -Be 1
156+
($script:parsedEntry).Count | Should -Be 1
156157
}
157158

158159
It 'Parses the correct number of lines per session' {
159-
$parsedEntry.logs.Count | Should -Be 10
160+
$script:parsedEntry.logs.Count | Should -Be 10
160161
}
161162

162163
It 'Detects the exit code' {
163-
$parsedEntry.exitCode | Should -Be 900
164+
$script:parsedEntry.exitCode | Should -Be 900
164165
}
165166

166167
It 'Detects the right session number' {
167-
$parsedEntry.thread | Should -Be 54321
168+
$script:parsedEntry.thread | Should -Be 54321
168169
}
169170

170171
It 'Has Configuration with Subkeys' {
171-
$parsedEntry.Configuration['Features']['UsePackageExitCodes'] | Should -Be 'True'
172+
$script:parsedEntry.Configuration['Features']['UsePackageExitCodes'] | Should -Be 'True'
172173
}
173174
}
174175

175176
Context 'For Folder Path' {
176177
It 'Parses the correct default number of sessions' {
177178
# Should still only return 1 regardless of folder
178-
($multipleEntry).Count | Should -Be 1
179+
($script:multipleEntry).Count | Should -Be 1
179180
}
180181

181182
It 'Parses the correct number of lines per session' {
182-
$multipleEntry.logs.Count | Should -Be 2
183+
$script:multipleEntry.logs.Count | Should -Be 2
183184
}
184185
}
185186
}

0 commit comments

Comments
 (0)