Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Distributed processing and user secrets
rodtan
#1 Posted : Thursday, November 19, 2020 9:48:05 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 9/5/2018(UTC)
Posts: 4
Location: Norway

Thanks: 2 times
I am trying out ditributed processing for the first time, and have successfully set up a node. However, tests that rely on settings found in the project user secrets appear to be unavailable to the node. is there a way to copy user screts to the node that I have missed?

Example:

appsettings.json
Code:
{
  "My": {
    "Setting":"#{Placeholder}#"
  }
}


secrets.json
Code:
{
  "My": {
    "Setting":"42"
  }
}


Test fails with message:
System.InvalidOperationException: Failed to convert '#{Placeholder}#' to type 'System.Int32'.

'Copy Referenced Assemblies To Workspace' is turned on.
Remco
#2 Posted : Thursday, November 19, 2020 11:33:02 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi, thanks for posting.

If I understand the way that secrets are intended to work, they are essentially parameters that are supposed to be specific to the machine on which the code is being executed.

This is somewhat of an issue for distributed processing. Clearly the intent of distributed processing is usually to try and run the tests in the same way as they would exist on the client machine. However, this is not always the case. For example, your code may have a database connection string that might be different between your local machine and the grid node (which perhaps has a local instance with a different password).

Right now, we have no facility to copy secrets from the user machine to the remote grid node, and there are likely to be many barriers to prevent us from doing so, given the secrets are intended to be stored locally securely. So this is likely to be tricky for us to implement on the NCrunch side and may not actually be a good idea either.

So the solution here is to either avoid using secrets or make sure you have manually replicated them across your grid nodes.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.027 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download