Skip to content

Adds draft caching mechanism - #461

Open
indented-automation wants to merge 2 commits into
PowerShellOrg:mainfrom
indented-automation:adds-test-caching
Open

Adds draft caching mechanism#461
indented-automation wants to merge 2 commits into
PowerShellOrg:mainfrom
indented-automation:adds-test-caching

Conversation

@indented-automation

Copy link
Copy Markdown
Contributor

PR Summary

Fixes #457

Context

This potentially fixes issue 457 by adding a caching mechanism. When a koan is evaluated for the first time the results of that evaluation are cached (as clixml). Clixml is used to attempt to ensure that error messages are presented in the same manner as a direct run.

This update changes the execution time of Measure-Karma to a fairly static value of around 2000ms which flucuates only based on the current in-progress topic.

Cached results are stored in ~\config\PSKoans\cache.

Changes

  • Adds new initialization script, InitializeCache.ps1
  • Adds new private command: Add-KoanCachedResult
  • Adds new private command: Get-KoanCachedResult
  • Adds cache retrieval and addition to Invoke-Koan
  • Fixes a bug in the Verbose output from Measure-Koan
  • Propagates selection of pester version into the runspace created by New-KoanRunspace, ensures consistency in the version picker.

Checklist

  • Pull Request has a meaningful title.
  • Summarised changes.
  • Pull Request is ready to merge & is not WIP.
  • Added tests / only testable interactively.
    • Make sure you add a new test if old tests do not effectively test the code changed.
  • Added documentation / opened issue to track adding documentation at a later date.

@vexx32
vexx32 marked this pull request as draft September 14, 2021 12:26
@indented-automation

Copy link
Copy Markdown
Contributor Author

So the test run... My new tests work locally when I force-load Pester 5.0.2 to ensure everything is nicely lined up.

Several of the sanity tests still fail though. They're a bit incompatible with latest versions of Pester 5 right now.

A few of the tests are actually acting out changes. For instance I get Show-Advice pushed into my profile script no matter what.

Would you like me to fix these things?

@vexx32

vexx32 commented Nov 1, 2021

Copy link
Copy Markdown
Collaborator

If you have time to sort them out, please feel free 😅

I've been meaning to sort them out for a long time, but I haven't had the time/energy. 😔

@indented-automation
indented-automation marked this pull request as ready for review November 18, 2021 16:59
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.

Enumeration time is quite long the more you progress

2 participants