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

Do not load applications from CT provider #2761

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Nov 27, 2022

  1. Do not load applications from CT provider

    Currenlty CT provider tries to load each application mentioned in
    `sys_config` files.  This may silently fail (and in most cases it does)
    if the application is not found in the code path.  At the same time
    a provider that we can run before CT can add the application directory
    into the code path and make it happen.
    
    For exmaple, if we want to tweak configuration for one of our test
    suites, we can put something like the following in `init_per_suite/1`:
    
        ok = application:load(acme),
        ok = application:set_env(acme, param, SomeValue),
        {ok, _} = application:ensure_all_started(acme),
    
    Then `rebar3 ct` will pass.  But `rebar3 do eunit, ct` will fail, since
    the application will already be loaded.
    
    However, the problem is not with the code path itself.  Seems like CT
    provider should not load applications from `sys_config` files.  This way
    it will mimic `-config` option more closely: application is not loaded,
    application parameters read from file persisted in application
    controller state and won't be available until the application is loaded.
    It will also fix `rebar3 do eunit, ct` in the above example.
    dmitrivereshchagin committed Nov 27, 2022
    Configuration menu
    Copy the full SHA
    e8a7b82 View commit details
    Browse the repository at this point in the history