Skip to content

Run Pester script tests in PRs and a dedicated nightly workflow#327

Merged
StuartFerguson merged 7 commits intomasterfrom
copilot/add-settlement-processing-script
Mar 12, 2026
Merged

Run Pester script tests in PRs and a dedicated nightly workflow#327
StuartFerguson merged 7 commits intomasterfrom
copilot/add-settlement-processing-script

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

This adds CI coverage for the existing PowerShell test suite under Scripts/Tests on both pull requests and nightly automation. PR validation stays in pullrequest.yml; nightly execution moves to a dedicated workflow instead of sharing the maintenance pipeline.

  • PR coverage

    • Adds a pester-tests job to .github/workflows/pullrequest.yml
    • Runs the existing Scripts/Tests suite with pwsh
  • Nightly coverage

    • Adds .github/workflows/powershell_nightly.yml
    • Schedules the same Pester suite to run nightly and supports manual dispatch
  • Workflow separation

    • Removes the script-test job from .github/workflows/repository_maintenance.yml
    • Keeps maintenance concerns isolated from test execution
  • Workflow hardening

    • Scopes the new test jobs to read-only repository permissions
    • Bootstraps Pester only when it is not already present on the runner
jobs:
  pester-tests:
    runs-on: ubuntu-latest
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@v4
      - name: Ensure Pester is Available
        shell: pwsh
        run: |
          if (-not (Get-Module -ListAvailable -Name Pester)) {
            Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser
          }
      - name: Run Pester Tests
        shell: pwsh
        run: |
          Invoke-Pester -Path ./Scripts/Tests -CI
Original prompt

This section details on the original issue you should resolve

<issue_title>Settlement Processing</issue_title>
<issue_description>Need a scheduled task to run once a day and a powershell script to do the following

Get a client access token (securityServiceUrl/connect/token)
Get a list of merchants (baseurl/api/v2/estates/estateId/merchants) where estateId is the parameter passed in
for each merchant in the returned list
{
make a post to perform the settlement (baseUrl/api/estates/estateId/settlements/pendingSettlementDate/merchants/merchantId)
estate id is the parameter passed in to the script
merchantid is the current merchant
pendingSettlementDate is current date
}

The script will accept 5 mandatory parameters

  • estateId
  • baseUrl
  • securityServiceUrl
  • clientid
  • clientsecret

Any questions ask.

Is there a way to build some kind of unit test for this script ?

As part of the job can you build me an xml file that I can import to set the task up
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add daily scheduled task for settlement processing Add daily settlement PowerShell job and Task Scheduler template Mar 12, 2026
Copilot AI and others added 2 commits March 12, 2026 14:33
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Comment thread .github/workflows/pullrequest.yml Fixed
Comment thread .github/workflows/repository_maintenance.yml Fixed
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title Add daily settlement PowerShell job and Task Scheduler template Run PowerShell script tests in PR and nightly workflows Mar 12, 2026
Co-authored-by: StuartFerguson <16325469+StuartFerguson@users.noreply.github.com>
Copilot AI changed the title Run PowerShell script tests in PR and nightly workflows Run Pester script tests in PRs and a dedicated nightly workflow Mar 12, 2026
@StuartFerguson StuartFerguson marked this pull request as ready for review March 12, 2026 14:45
@StuartFerguson StuartFerguson merged commit 32f4fce into master Mar 12, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settlement Processing

3 participants