Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds draft caching mechanism #461

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

indented-automation
Copy link
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.

@indented-automation
Copy link
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
Copy link
Owner

vexx32 commented Nov 1, 2021

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