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

docker: fix wrong state of example #1276

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

atline
Copy link
Contributor

@atline atline commented Sep 30, 2023

examples/docker: pytest -s --lg-env env.yaml test_shell.py will print next error:

______________________ ERROR at setup of test_shell ______________________

target = Target(name='main', env=Environment(config_file='env.yaml'))

    @pytest.fixture(scope='session')
    def command(target):
        strategy = target.get_driver('DockerStrategy')
>       strategy.transition("shell")

conftest.py:6:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../labgrid/step.py:215: in wrapper
    _result = func(*_args, **_kwargs)
../../labgrid/strategy/dockerstrategy.py:39: in transition
    status = Status[status]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cls = <enum 'Status'>, name = 'shell'

    def __getitem__(cls, name):
>       return cls._member_map_[name]
E       KeyError: 'shell'

/usr/lib/python3.8/enum.py:387: KeyError

This is because there is no shell state in dockerstrategy, it should be accessible.

Signed-off-by: Larry Shen <larry.shen@nxp.com>
@codecov
Copy link

codecov bot commented Sep 30, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (342dc90) 63.0% compared to head (e6fa794) 63.0%.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1276     +/-   ##
========================================
- Coverage    63.0%   63.0%   -0.1%     
========================================
  Files         160     160             
  Lines       11859   11859             
========================================
- Hits         7482    7481      -1     
- Misses       4377    4378      +1     

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Emantor Emantor merged commit fc3afcb into labgrid-project:master Oct 1, 2023
8 of 9 checks passed
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.

3 participants