Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Migrates to Pester5+ tests #59

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
7708df9
Update pwsh style to latest community standards (#52)
OCram85 Jun 28, 2022
4abfec5
adds PR template (#55)
OCram85 Jun 28, 2022
c45490a
Update issue templates (#56)
OCram85 Jun 28, 2022
c31ee79
Update issue templates (#57)
OCram85 Jun 28, 2022
88743e9
fix pester verbosity config (#58)
OCram85 Jun 28, 2022
aef82de
test Pester5 file
OCram85 Jun 28, 2022
a4fa937
fix typo
OCram85 Jun 28, 2022
8b45618
debug
OCram85 Jun 28, 2022
b496eaa
add workaround for psscript analyzer object reference error
OCram85 Jun 28, 2022
2f554c1
fix typo in output var
OCram85 Jun 28, 2022
ac0431e
wip
OCram85 Jun 28, 2022
5b4d043
wip
OCram85 Jun 28, 2022
166efda
stop on error
OCram85 Jun 28, 2022
c3ac2d2
wip
OCram85 Jun 28, 2022
eb791af
wip
OCram85 Jun 28, 2022
f8cb6f9
wip
OCram85 Jun 28, 2022
981068d
wip
OCram85 Jun 28, 2022
a845c04
wip
OCram85 Jun 28, 2022
e9529bd
wip
OCram85 Jun 28, 2022
b9ebc2a
wip
OCram85 Jun 28, 2022
8808f1c
wip
OCram85 Jun 28, 2022
c7529b5
wip
OCram85 Jun 28, 2022
9f9e895
wip
OCram85 Jun 28, 2022
efcd905
fix linter issues
OCram85 Jun 28, 2022
ecd2735
wip
OCram85 Jun 28, 2022
e60ee4c
wip
OCram85 Jun 28, 2022
ef3fd6d
wip
OCram85 Jun 28, 2022
90d41aa
wip
OCram85 Jun 28, 2022
20f5fe7
wip
OCram85 Jun 28, 2022
f90741d
try to mock private module function outside of module scope
OCram85 Jun 28, 2022
8e73cf3
wip
OCram85 Jun 28, 2022
01de79f
wip
OCram85 Jun 28, 2022
9a5693d
wip
OCram85 Jun 29, 2022
89be8ad
add pwsh lts
OCram85 Jun 29, 2022
89a4105
wip
OCram85 Jun 29, 2022
2fd83fe
add debug output
OCram85 Jun 29, 2022
5353e47
wip
OCram85 Jun 29, 2022
be156ab
wip
OCram85 Jun 29, 2022
d2582e7
wip
OCram85 Jun 30, 2022
4307159
wip
OCram85 Jun 30, 2022
4ff1de5
wip
OCram85 Jun 30, 2022
bf54902
wip
OCram85 Jul 1, 2022
cd7b986
wip
OCram85 Jul 1, 2022
ab96d9d
wip
OCram85 Jul 1, 2022
642af42
wip
OCram85 Jul 1, 2022
d34b574
wip
OCram85 Jul 1, 2022
2045dad
add build meta ignore
OCram85 Jul 4, 2022
5b9cfd8
remove obsolete mocking syntax for privates
OCram85 Jul 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 63 additions & 32 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,63 @@
---
kind: pipeline
type: docker
name: Linux_PWSH7_Build

platform:
os: linux
arch: amd64

steps:
- name: Environments
image: mcr.microsoft.com/powershell:latest
commands:
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-ShowEnv -Verbose}"
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1' -Verbose; Invoke-InstallDependencies -Verbose}"
- name: LintTests
image: mcr.microsoft.com/powershell:latest
commands:
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-Linter}"
- name: UnitTests
image: mcr.microsoft.com/powershell:latest
commands:
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-InstallDependencies}"
- pwsh -NonInteractive -c "& {Import-Module './tools/DroneIO.psm1'; Invoke-UnitTests}"
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: CodeCovToken
files:
- coverage.xml
---
kind: pipeline
type: docker
name: PWSH_LTS_7.2_Ubuntu-focal

platform:
os: linux
arch: amd64

steps:
- name: Environments
image: mcr.microsoft.com/powershell:lts-7.2-ubuntu-focal
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DroneIO.psm1' -Verbose;
Invoke-ShowEnv -Verbose
}"

- name: LintTests
image: mcr.microsoft.com/powershell:lts-7.2-ubuntu-focal
failure: ignore
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DroneIO.psm1';
Invoke-InstallDependencies;
Invoke-Linter -ErrorAction 'Stop'
}"

- name: UnitTests
image: mcr.microsoft.com/powershell:lts-7.2-ubuntu-focal
failure: ignore
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DroneIO.psm1';
Invoke-InstallDependencies;
Invoke-UnitTest -Verbosity 'Normal' -ExcludeTag @( 'Integration', 'Disabled') -ErrorAction 'Stop'
}"

- name: Coverage
image: plugins/codecov
settings:
token:
from_secret: CodeCovToken
files:
- coverage.xml
depends_on:
- UnitTests

- name: SetPipelineState
image: mcr.microsoft.com/powershell:lts-7.2-ubuntu-focal
commands:
- |
pwsh -NonInteractive -c "& {
Import-Module './tools/DroneIO.psm1';
Invoke-BuildState -ErrorAction 'Stop'
}"
depends_on:
- LintTests
- UnitTests
- Coverage
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true


[*.yml]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{.gitattributes,.gitignore,.gitkeep}]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
26 changes: 24 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,24 @@
src/Vendor/libressl255/* filter=lfs diff=lfs merge=lfs -text
*.pfx filter=lfs diff=lfs merge=lfs -text
# images
*.jpg binary
*.jpeg binary
*.bmp binary
*.tiff binary
*.png binary
*.svg binary
*.ico binary

# binary files
*.exe binary
*.dll binary

# PowerShell specific
*.ps1 working-tree-encoding=UTF-8
*.psm1 working-tree-encoding=UTF-8
*.psd1 working-tree-encoding=UTF-8

# set markdown to lf for online editing
*.md working-tree-encoding=UTF-8

# Vendor resources config
src/Vendor/libressl255/* filter=lfs diff=lfs merge=lfs -text
*.pfx filter=lfs diff=lfs merge=lfs -text
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Bug report
about: This template is used to report bugs!
title: ":lady_beetle: "
labels: bug
assignees: OCram85

---

<!--
This bug report is ony for content provided in this repository!

- Make sure you're able to reproduce the error in the lastest version of this package.
- Search of already existing issues.
- Refer to the known issues and FAQ section.
-->

#### :bomb: Steps to reproduce

```bash

```

#### :rocket: Expected behavior

```bash

```

#### :boom: Actual behavior

```bash

```

#### :notebook: Environment data

<!-- You can add additional environment data here--->

```bash

```

#### :framed_picture: Screenshots

<!-- Paste your screenshots here. -->

#### :bookmark: Refs

<!-- A place for addtional references to othe issues and PRs -->
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Default
about: Use this template if nothing seems to work.
title: ":question: "
labels: question
assignees: ''

---

#### :grey_question: Simply ask your question here: :grey_question:

<!-- Take your time an think about your problem.... -->
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature request
about: Suggest an idea for this project
title: ":flying_saucer: "
labels: enhancement
assignees: ''

---

<!--
This issue template is used to describe whished features.
-->

#### :satellite: Suggestion



#### :artificial_satellite: Implementation ideas



#### :framed_picture: Mock-up Images



#### :bookmark: Refs.
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#### :book: Summary

<!-- Provide a summary of your changes. Describe the why and not how. -->

#### :bookmark_tabs: Test Plan

> :bulb: Select your test plan for the code changes.

- [ ] Tested via Drone.io pipeline
- [ ] Custom test
- [ ] No test plan

##### Details / Justification

<!-- Add your test details or justification for missing tests here. -->

#### :books: Additional Notes

<!-- A place for additional detail notes. -->
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
# Don't local track test builds
bin/PSCredentialStore.zip
bin/PSCredentialStore/*
# Don't local track test builds
bin/PSCredentialStore.zip
bin/PSCredentialStore/*

# Basic ignore patterns
*.log
*.secret

# data dir related prod files
data/*.csv

# Ignore templ build artifacts
/bin/*
!bin/.gitkeep

# Ignore Unit Test result files
coverage.xml
testResults.xml

# Optional build state file
STATE.xml
62 changes: 22 additions & 40 deletions .vscode/cSpell.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,22 @@
// cSpell Settings
{
// Version of the setting file. Always 0.1
"version": "0.1",
// language - current active spelling language
"language": "en",
// words - list of words to be always considered correct
"words": [
"Cmdlet",
"Cmdlets",
"GUID",
"Hashtable",
"Httpclient",
"Multipart",
"NTFS",
"Params",
"Ponduit",
"Repo",
"Veyor",
"appveyor",
"callsign",
"choco",
"chocolatey",
"codecoverage",
"creds",
"formdata",
"googlemail",
"notlike",
"notmatch",
"powershellgallery",
"testresults",
"wildcards"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": [
"hte"
]
}
// cSpell Settings
{
// Version of the setting file. Always 0.1
"version": "0.2",
// language - current active spelling language
"language": "en,de,de-DE",
// words - list of words to be always considered correct
"words": [],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": [],
"dictionaryDefinitions": [
{
"name": "default",
"path": "./dictionaries/default.txt"
}
],
"dictionaries": [
"default"
]
}
File renamed without changes.
13 changes: 13 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"recommendations": [
"streetsidesoftware.code-spell-checker",
"streetsidesoftware.code-spell-checker-german",
"hediet.vscode-drawio",
"editorconfig.editorconfig",
"eamodio.gitlens",
"vscode-icons-team.vscode-icons",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"ryanluker.vscode-coverage-gutters"
]
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": ""
"cwd": "${workspaceRoot}"
}
]
}
Loading