Skip to content

Conversation

@DavidVujic
Copy link
Owner

@DavidVujic DavidVujic commented Oct 21, 2023

Description

Add possibility to print changes only for bricks.

Adding the option --bricks.

Combinations

As-is

poetry poly diff

As-is

poetry poly diff --short

New

poetry poly diff --bricks
diff bricks

Short, useful for CI and/or running tests for changed code only

New

poetry poly diff --bricks --short
diff bricks short

Motivation and Context

This is useful when running tests for changed bricks only.

Fixes #116

Example usage:

# store the diff in a bash variable
changes=$(poetry poly diff --bricks --short)

# create a pytest query, i.e. "hello or world or something"
query=${changes//,/ or }

# run the test, filtered by keyword expression.
poetry run pytest -k <<< echo $query

# or run the test, filtered by pytest markers
poetry run pytest -m <<< echo $query

How Has This Been Tested?

Local install and tested with the python-polylith-example repo.
CI ✅

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

@DavidVujic DavidVujic changed the title feat(poly diff): possible to print isolated changes for projects, bases and components feat(poly diff): print changes for projects and bricks Oct 21, 2023
@DavidVujic DavidVujic changed the title feat(poly diff): print changes for projects and bricks feat(poly diff): print changes for projects and/or bricks Oct 21, 2023
@DavidVujic DavidVujic marked this pull request as ready for review October 21, 2023 12:21
@DavidVujic DavidVujic force-pushed the poly-test-command branch 2 times, most recently from 74b3411 to e44a497 Compare October 21, 2023 14:03
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@DavidVujic DavidVujic merged commit ac058c9 into main Oct 21, 2023
@DavidVujic DavidVujic deleted the poly-test-command branch October 21, 2023 14:27
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.

Poly diff to list changed bases/components for CI testing

2 participants