Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MichalHe
Copy link
Member

Intoduce make target that lints only files changed compared to the master.

@github-actions
Copy link

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergable.
If you want to re-run tests or request review, you can use following commands as a comment:

  • leapp-ci build to run copr build and e2e tests in OAMG CI
  • review please to notify leapp developers of review request
  • /packit copr-build to submit a public copr build using packit

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@centos-ci
Copy link

Can one of the admins verify this patch?

MichalHe added 2 commits October 4, 2021 09:57
Introduce fast_lint target enabling the developer to quickly lint only
files that have been modified on the current branch compared to master.

Also introduces the ENTER_VENV variable that expands to the command for
entering venv when not running as root or to empty string when running
as root, simplifying the recipes that require slightly different logic
when running as root or normal user.

This target contains the same recipe as the fast_lint target introduced
in leapp-repository.
Remove the conditional checking of the userid and instead use
ENTER_VENV variable that will expand to empty string if we are running
as root.
@MichalHe
Copy link
Member Author

MichalHe commented Oct 4, 2021

Refactoring - executed commands outputs:

Normal user:

make --dry-run lint

Before:

. tut/bin/activate ; \
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py

After:

. tut/bin/activate; \
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py

make --dry-run test

Before:

. tut/bin/activate ; \
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py
. tut/bin/activate ; \
pytest -vv --cov-report term-missing --cov=leapp tests/scripts

After:

. tut/bin/activate; \
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py
. tut/bin/activate; \
pytest -vv --cov-report term-missing --cov=leapp tests/scripts

running as root

make --dry-run lint

Before:

pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py

After:

\
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py

make --dry-run test

Before:

pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py
pytest -vv --cov-report term-missing --cov=leapp tests/scripts

After:

\
pytest --cache-clear --pylint -m pylint leapp tests/scripts/*.py; \
pytest --cache-clear --flake8 -m flake8 leapp tests/scripts/*.py
\
pytest -vv --cov-report term-missing --cov=leapp tests/scripts

@MichalHe MichalHe changed the title [WIP] Introduce the fast_lint make target. Introduce the fast_lint make target. Oct 4, 2021
@fernflower
Copy link
Member

/rerun

@github-actions
Copy link

Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/2883827

@github-actions
Copy link

Testing Farm request for tmt test was created. Once finished, results should be available here.
Full pipeline log.

Copy link
Member

@pirat89 pirat89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. nice work! :) ergarding the failed integration tests, the results are irrelevant as the change is not affecting the leapp behaviour and the discovered issues are related to an infrastracture problems. Merging.

@pirat89 pirat89 merged commit c8faeb1 into oamg:master Oct 11, 2021
pirat89 added a commit to pirat89/leapp that referenced this pull request Oct 19, 2021
## Packaging
- Drop the dependency on leapp-repository for Fedora and RHEL 8+ (oamg#717)
- Provide builds for RHEL 7+ and Fedora (oamg#717)
- Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (oamg#717, oamg#716)
- Bump the provided leapp-framework capability to 2.0 (oamg#700)

## Framework
### Fixes
- models: Do not make references to private symbols (oamg#718)

### Enhancements
- Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (oamg#732)

## Leapp
### Fixes
- Fix print of the leapp help msg for Python 3.6+ (oamg#731)

### Enhancements
- The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (oamg#700)
- Add CLI support for `choices` and `default` for options of leapp commands (oamg#734)

## Modifications
- Makefile: Added the `fast_lint` target to apply linters just on files different from master (oamg#733)
@pirat89 pirat89 mentioned this pull request Oct 19, 2021
pirat89 added a commit to pirat89/leapp that referenced this pull request Oct 19, 2021
## Packaging
- Drop the dependency on leapp-repository for Fedora and RHEL 8+ (oamg#717)
- Provide builds for RHEL 7+ and Fedora (oamg#717)
- Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (oamg#717, oamg#716)
- Bump the provided leapp-framework capability to 2.0 (oamg#700)

## Framework
### Fixes
- models: Do not make references to private symbols (oamg#718)

### Enhancements
- Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (oamg#732)

## Leapp
### Fixes
- Fix print of the leapp help msg for Python 3.6+ (oamg#731)

### Enhancements
- The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (oamg#700)
- Add CLI support for `choices` and `default` for options of leapp commands (oamg#734)

## Modifications
- Makefile: Added the `fast_lint` target to apply linters just on files different from master (oamg#733)
pirat89 added a commit that referenced this pull request Oct 19, 2021
## Packaging
- Drop the dependency on leapp-repository for Fedora and RHEL 8+ (#717)
- Provide builds for RHEL 7+ and Fedora (#717)
- Drop automatically generated Python dependences on RHEL 8+ and Fedora systems (#717, #716)
- Bump the provided leapp-framework capability to 2.0 (#700)

## Framework
### Fixes
- models: Do not make references to private symbols (#718)

### Enhancements
- Introduce the LEAPP_DEVEL_DATABASE_SYNC_OFF envar to enable speed up writes into the leapp database by disabling synchronisation - only for development / testing purposes (#732)

## Leapp
### Fixes
- Fix print of the leapp help msg for Python 3.6+ (#731)

### Enhancements
- The leapp commands are now defined/provided by leapp-repositories; leapp discovers the specified commands automatically (#700)
- Add CLI support for `choices` and `default` for options of leapp commands (#734)

## Modifications
- Makefile: Added the `fast_lint` target to apply linters just on files different from master (#733)
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.

4 participants