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

Store vars in a separate file #52

Open
MelaAxel opened this issue Dec 12, 2023 · 3 comments
Open

Store vars in a separate file #52

MelaAxel opened this issue Dec 12, 2023 · 3 comments
Assignees
Labels
In Progress currently in development issue:question Further information is requested

Comments

@MelaAxel
Copy link
Contributor

MelaAxel commented Dec 12, 2023

I have need to point different runs to different TestRail projects, so I need to specify that config at execution. That works fine by using the proper flags for the Cy run. However, for security, I don't want my TestRail creds stored in those env.json files; additionally, to limit the duplication of files in my setup, I want to use a 'testrail.json' file to store all the config settings that I will reference for that run.

Dumbing this down to a single file / config, I've moved the 'testrail' section of the env.json into a testrail.json file and tried using a $ref:
image
image

but I get this error:
image

What am I missing to get this working correctly while storing these variables in a referenced file?

@boxblinkracer
Copy link
Owner

Hi there

aehm...not quite sure if $ref works out of the box, because I would probably need to support that :)
so you cant just invent a new parameter in that part of the config-file with my code

but let me first ask.. you know that alle these things can be added as ENV variable directly when executing it?

so what you are trying to say is that you DO want a file-based storage, but it should just not be the cypress.env.json?

I could add a fallback lookup for testrail.json in that case and it will work

what do you think?
can you clear up things for me and verify my assumption? thank you :)

@boxblinkracer boxblinkracer added issue:question Further information is requested In Progress currently in development labels Jan 26, 2024
@boxblinkracer boxblinkracer self-assigned this Feb 1, 2024
@MelaAxel
Copy link
Contributor Author

@boxblinkracer Thanks, I guess I thought it should work based on it being a standard in the schema (https://json-schema.org/understanding-json-schema/structuring#dollarref)...

Anywho... so yes, I do want to have file-based storage for these as I don't want to muddy the waters of my pipelines AND that I need to have various sets based on the pipeline.

Adding a fallback should work but what does the implementation path look like to support $ref instead?

@MelaAxel
Copy link
Contributor Author

MelaAxel commented May 6, 2024

After thinking on this for a few more days, maybe it's easier to just look at the fallback option for the creds and I can specify the rest in the vars in specific env files I'll call in the cli...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Progress currently in development issue:question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants