0

I have some specflow tests which use runsettings files to pass parameters through to the test cases and some of these parameters are secrets.

In our build pipeline & release pipelines on ADO I have it figured out that I can choose the run settings file and override parameters with those on the pipeline variables but I am trying to figure out a way that we can still run these tests locally.

I want to be able to create user secrets using the .net tool and somehow get these passed into the tests at runtime and replace anything in the runsettings with the matching ID.

I don't want it to write anything into the runsettings files as this still poses a risk that someone might commit the runsettings files with the secrets in.

Any idea how I can accomplish this as struggling to find anything

Webezine
  • 345
  • 7
  • 22
  • *"I don't want it to write anything into the runsettings files as this still poses a risk that someone might commit the runsettings files with the secrets in."* — this should be caught during code reviews. If you are not doing code reviews for this, you should be. Local settings should be committed to version control. Use pipeline variables to replace those settings in Azure DevOps with secrets. That's how it is done. – Greg Burghardt Jun 24 '22 at 17:57
  • As stated in the question this wasn't for a pipeline and was for local ONLY so your comment isn't really relevant. but thanks for trying. – Webezine Jun 27 '22 at 13:08
  • Is the runsettings file already in version control? And if so, which version control system do you use? Maybe you just need to configure your VCS to ignore changes to the runsettings files. – Greg Burghardt Jun 27 '22 at 14:30
  • Think you're missing the point of this question - it was to find a way to replace runsettings locally with user secrets or another mechanism - it has nothing to do with pipelines or version control. – Webezine Jun 28 '22 at 07:29
  • I understand the question perfectly fine. I'm just asking more about the application development environment so I can help with a proper solution. – Greg Burghardt Jun 28 '22 at 11:52

0 Answers0