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

Unit tests for added merging functionality #31

Closed
wants to merge 1 commit into from

Conversation

jankowtf
Copy link

@jankowtf jankowtf commented Jan 3, 2021

Related to #30

Still requires three config files in tests/testthat/merging/ in order to work

Related to https://github.com/rappster/config/tree/patch-1

Still requires three config files in `tests/testthat/merging/` in order to work
@jankowtf
Copy link
Author

jankowtf commented Jan 3, 2021

Content of tests/testthat/merging/config_01.yml:

# Example of a structural change (named to unnamed)
# Entire 'host' element should be overwritten
default:
  host:
    url: https://dev-server.com
    port: 8000

prod:
  host:
    - id: server_001
      url: https://prod-server-001.com
      port: 8000
    - id: server_002
      url: https://prod-server-002.com
      port: 8000
  hello:
    world: true
``

@jankowtf
Copy link
Author

jankowtf commented Jan 3, 2021

Content of tests/testthat/merging/config_02.yml:

# Example of merging unnamed lists where UID information is contained in non-nested list
# - server_001 should be overwritten
# - server_002 shold be kept
# - server_003 should be added
default:
  host:
    - id: server_001
      url: https://standard-server-001.com
      port: 8000
    - id: server_002
      url: https://standard-server-002.com
      port: 8000

peak:
  host:
    - id: server_001
      url: https://peak-server-001.com
      port: 8000
    - id: server_003
      url: https://standard-server-003.com
      port: 8000
  hello:
    world: true
``

@jankowtf
Copy link
Author

jankowtf commented Jan 3, 2021

Content of tests/testthat/merging/config_03.yml:

# Example of merging unnamed lists where UID information is contained in nested list
# - server_001 should be overwritten
# - server_002 shold be kept
# - server_003 should be added

default:
  host:
    - info:
        id: server-001
        description: standard server-001
      url: https://standard-server-001.com
      port: 8000
    - info:
        id: server-002
        description: standard server-002
      url: https://standard-server-002.com
      port: 8000

peak:
  host:
    - info:
        id: server-001
        description: peak server-001
      url: https://peak-server-001.com
      port: 8000
    - info:
        id: server-003
        description: standard server-003
      url: https://standard-server-003.com
      port: 8000
  hello:
    world: true

@jankowtf
Copy link
Author

jankowtf commented Jan 3, 2021

Closed due to more self-contained unit tests added via #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant