Code Monkey home page Code Monkey logo

Comments (4)

PlagueHO avatar PlagueHO commented on June 28, 2024

Sounds reasonable to me.

from dscresource.tests.

johlju avatar johlju commented on June 28, 2024

Looking at this issue, I see that there is only one place where Install-Module is run in tests, that are meant to be run by a user. All other locations are meant to be run in AppVeyor only, or in a container that is only present for the test run.

One place that Install-Module is used is in the Meta.Tests.ps1. It calls Install-DependentModule which in turn calls Install-Module and installs in the CurrentUser scope. Meta.Tests.ps1 could be run by a user.

$requiredModules = Get-ResourceModulesInConfiguration -ConfigurationPath $exampleToValidate.FullName |
Where-Object -Property Name -ne $moduleName
if ($requiredModules)
{
Install-DependentModule -Module $requiredModules
}

So what we could do is make the Install-DependentModule helper function return the modules and the version that was installed, so we can remove that version, or the entire module, if that was the only version. We can't always remove the entire folder, because the user might have the dependent module installed already.

from dscresource.tests.

johlju avatar johlju commented on June 28, 2024

@PlagueHO what is your opinion on this today? Is this worth solving, and to what extent?

from dscresource.tests.

PlagueHO avatar PlagueHO commented on June 28, 2024

This one goes back quite some time! 😁

Perhaps we could just install the module to the local scope if they aren't installed (or an older version is installed).

But, we could also look at using a module like PSDepend to start managing these dependencies. Although of course the PSDepend module still needs to be bootstrapped.

from dscresource.tests.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.