Giter VIP home page Giter VIP logo

Comments (7)

rakaramos avatar rakaramos commented on September 10, 2024 1

@rakaramos @ZevEisenberg A solution needs to be provided for this problem that will be happening on every muter run on SPM with at least one dependency. With that in mind, I want your opinion on implementing the following solution:

The developer will have the ability to provide environment variables through muter configuration. So in this Usecase the user would give the following env var and we would would set it like this which will solve the problem.

process.environment = ["PATH": "/usr/local/bin:/usr/bin:/bin"] // Found this from swift forums

That way not only will we solve this problem but we will also give the ability to developer to set env vars which may be needed.

What do you think about this?

Thanks for the investigation!
I think that a better approach is to copy all the env vars from the process info to the underlying muter process, I'll run a few tests and will issue a PR if it fixes it.

from muter.

Nikoloutsos avatar Nikoloutsos commented on September 10, 2024

Hello @gsl-anthonymerle
Thank you for taking the time to report this issue I will take a look at it later

from muter.

gsl-anthonymerle avatar gsl-anthonymerle commented on September 10, 2024

My pleasure, thanks @Nikoloutsos

from muter.

Nikoloutsos avatar Nikoloutsos commented on September 10, 2024

@gsl-anthonymerle Your code helped reproduce the issue.
At first, I tried running without any SPM dependencies and it was working but whenever I added at least one SPM dependency it was always failing.

The problem looks like is that swift test tries to resolve the packages but Github refuses to provide it.
After some debugging I found this on swift forum which explains the problem.

Workaround:
Change the Package.swift to use SSH authentication:

dependencies: [
        .package(
-            url: "https://github.com/approvals/ApprovalTests.Swift",
+            url: "[email protected]:approvals/ApprovalTests.Swift.git"
            branch: "master"
        ),
    ],

In the future I will try to fix this so that muter is running seamlessly on SPM packages with dependencies.

🎁 Bonus tip:
There is no need for you to exclude the Package.swift on the configuration since it is excluded by default. This was added in latest commit d44e78d

from muter.

Nikoloutsos avatar Nikoloutsos commented on September 10, 2024

@rakaramos @ZevEisenberg
A solution needs to be provided for this problem that will be happening on every muter run on SPM with at least one dependency.
With that in mind, I want your opinion on implementing the following solution:

The developer will have the ability to provide environment variables through muter configuration.
So in this Usecase the user would give the following env var and we would would set it like this which will solve the problem.

process.environment = ["PATH": "/usr/local/bin:/usr/bin:/bin"] // Found this from swift forums

That way not only will we solve this problem but we will also give the ability to developer to set env vars which may be needed.

What do you think about this?

from muter.

gsl-anthonymerle avatar gsl-anthonymerle commented on September 10, 2024

Hi @Nikoloutsos,

Thank you for your answer 🙏 Unfortunately, changing the http url to a git one doesn't change much, and I now get the following error:

Fetching [email protected]:approvals/ApprovalTests.Swift.git from cache
warning: 'approvaltests.swift': skipping cache due to an error: Couldn’t fetch updates from remote repositories:
Fetching [email protected]:approvals/ApprovalTests.Swift.git from cache
warning: 'approvaltests.swift': skipping cache due to an error: Couldn’t fetch updates from remote repositories:
error: Failed to clone repository [email protected]:approvals/ApprovalTests.Swift.git:

Is it something you ran into as well ?

Side note: I was using the Homebrew version, but I think it doesn't ship the latest changes that you talked before (like automatically ignoring Package.swift etc.), so I have now installed muter from the git repository

from muter.

Nikoloutsos avatar Nikoloutsos commented on September 10, 2024

Hello @gsl-anthonymerle 👋
Sorry for the late response, I just came back from holidays 😄

IIRC it was working fine for me, have you setup ssh for Github?
Probably now if you run the following on your terminal it is going to fail.

git clone [email protected]:gsl-anthonymerle/MuterPackageFailure.git

Take a look here and here on how you can generate an SSH key and add it into Github.

from muter.

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.