TestMace / TestMace-issues

Issues-only repository for issue management of TestMace
https://testmace.com
35 stars 6 forks source link

Local environment #26

Closed CAPCHIK closed 5 years ago

CAPCHIK commented 5 years ago

In case of work with API sometimes it is needed to use several resource URLs , for example local, remote dev, remote prod. Or some application secrets, test credentials.

And if I will share test mace project via GitHub, environment will be saved to index.yml. But sharing private data (like test credentials for development server) doesn't look pretty.

Today you can use OS environment variables and $systemVar built-in variable. In that case team should use the same OS environment, and keep some tool for changing variables (shell scripts?).

Possibility to have local environment instance, which can be passed to the team without project would be great.

CAPCHIK commented 5 years ago

As solution, some environments can be stored in separate files and be linked from index.yml And environment files with private data can be just git ignored For example, we have one file:

- index.yml

environments section:

  environments:
    local:
      url: 'http://localhost:5050'
      login: 'public login for local server'
      password: 'public password for local server'
    dev:
      url: 'https://devsite.com'
      login: 'private login for dev server'
      password: 'private password for dev server'
    prod:
      url: 'https://site.com'
      login: 'private users login for peoduction server'
      password: 'private users password for peoduction server'

So, dev and prod sections can be store in files devEnv.yml and prodEnv.yml (for example). And now we use three files:

- index.yml
- devEnv.yml (git ignored)
- prodEnv.yml (git ignored)

index.yml:

  environments:
    local:
      type: 'in-place'
      data:
        url: 'http://localhost:5050'
        login: 'public login for local server'
        password: 'public password for local server'
    dev:
      type: 'file'
      path: './devEnv.yml'
    prod:
      type: 'file'
      path: './prodEnv.yml'

devEnv.yml:

url: 'https://devsite.com'
login: 'private login for dev server'
password: 'private password for dev server'

prodEnv.yml

url: 'https://site.com'
login: 'private users login for peoduction server'
password: 'private users password for peoduction server'
dima11221122 commented 5 years ago

Thank you for detailed description. TestMace - electron based app, so we will use local storage for this feature. It'll allow to avoid problems with VCS and add security in comparison with plain files.

CAPCHIK commented 5 years ago

Thank you, I’ll be waiting for updates