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

Can't execute: Malformed tests.yml when environment is present #126

Closed
lukaszachy opened this issue Feb 26, 2020 · 4 comments
Closed

Can't execute: Malformed tests.yml when environment is present #126

lukaszachy opened this issue Feb 26, 2020 · 4 comments
Assignees
Labels
bug Something isn't working step | execute Stuff related to the execute step

Comments

@lukaszachy
Copy link
Collaborator

I am not able to execute test if it sets the environment.

Steps to reproduce:
Plan in file repro.fmf with content

summary:
    Basic smoke test
discover:
    how: fmf
execute:
    how: beakerlib

Test in main.fmf with content

test: ./runtest.sh
environment: {'BUNDLED_INJECT': 'PYTHONPATH=/usr/lib/python3.6/site-packages/pip/_vendor/',
 'PACKAGES': 'python3-pip',
 'PYTHON': 'python3'}

Execution as tmt run -d ends up with

   execute
        workdir: /var/tmp/tmt/run-055/repro/execute
        how: beakerlib
        Copy '/usr/lib/python3.7/site-packages/tmt/steps/execute/run.sh' to '/var/tmp/tmt/run-055/repro/execute'.
            Run command 'vagrant rsync'.
            out: ==> default: Rsyncing folder: /var/tmp/tmt/run-055/repro/ => /var/tmp/tmt/run-055/repro
            Run command 'vagrant ssh -c nohup /var/tmp/tmt/run-055/repro/execute/run.sh -v /var/tmp/tmt/run-055/repro beakerlib /var/tmp/tmt/run-055/repro/execute/stdout.log /var/tmp/tmt/run-055/repro/execute/stderr.log'.
            out: nohup: ignoring input and appending output to 'nohup.out'
            err: Connection to 192.168.122.226 closed.
            Run command 'bash -c "vagrant plugin list | grep '^vagrant-rsync-back '"'.
            out: vagrant-rsync-back (0.0.1, system)
            Run command 'vagrant rsync-back'.
            out: ==> default: Rsyncing folder: /var/tmp/tmt/run-055/repro/ => /var/tmp/tmt/run-055/repro
    stdout.log: ED

    stderr.log: 
         /var/tmp/tmt/run-055/repro $ main beakerlib < discover/tests.yaml
         > /one/repro:
         >     environment: BUNDLED_INJECT=PYTHONPATH=/usr/lib/python3.6/site-packages/pip/_vendor/
         >         PACKAGES=python3-pip PYTHON=python3
        Error: Unknown test variable:         PACKAGES=python3-pip PYTHON=python3
         >     path: /one/tests/repro
         >     test: ./runtest.sh
        Error: [/one/repro] Could not find test dir: '/var/tmp/tmt/run-055/repro/discover/one/tests/repro'
        overview: E
        result: 0 tests passed, 0 tests failed
 ERROR  1 errors occured during tests.

tests.yml from discover step has content

/one/repro:
    environment: BUNDLED_INJECT=PYTHONPATH=/usr/lib/python3.6/site-packages/pip/_vendor/
        PACKAGES=python3-pip PYTHON=python3
    path: /one/tests/repro
    test: ./runtest.sh
@lukaszachy lukaszachy added the bug Something isn't working label Feb 26, 2020
@pvalena
Copy link
Collaborator

pvalena commented Feb 26, 2020

        Error: Unknown test variable:         PACKAGES=python3-pip PYTHON=python3

What this says is that run.sh can't parse it (it's read from tests.yaml file). It is caused by the simple yaml-like format data parser (it cannot read full yaml), and I'd rather avoid implementing it in bash, if possible.

What I'd recommend is to have the long line not-wrapped, which would simply make it work again. @psss, can we fix that on the generator / python side?

@pvalena
Copy link
Collaborator

pvalena commented Feb 26, 2020

        Error: [/one/repro] Could not find test dir: '/var/tmp/tmt/run-055/repro/discover/one/tests/repro'

@lukaszachy is the dir intentionally nonexistent?

@lukaszachy
Copy link
Collaborator Author

        Error: [/one/repro] Could not find test dir: '/var/tmp/tmt/run-055/repro/discover/one/tests/repro'

@lukaszachy is the dir intentionally nonexistent?

Yes, I was trying to create simpler reproducer.

psss added a commit that referenced this issue Apr 3, 2020
Use very long width when exporting tests to run.yaml. Unfotunately
it seems that yaml does not support completely disabling wrapping.
@psss psss self-assigned this Apr 3, 2020
@psss
Copy link
Collaborator

psss commented Apr 3, 2020

Should be fixed by #188.

@psss psss added the step | execute Stuff related to the execute step label Apr 3, 2020
@psss psss closed this as completed in e9d6604 Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working step | execute Stuff related to the execute step
Projects
None yet
Development

No branches or pull requests

3 participants