Skip to content

Commit

Permalink
[yugabyte#8421] build: exclude other regress paths from build stamp
Browse files Browse the repository at this point in the history
Summary:
The negative pathspec to exclude some regress files when building
postgres build stamp only handles the src/postgres/src/test/regress
directory.  There are other places with tests, like
src/postgres/src/test/isolation and src/postgres/contrib.  Handle many
of these cases by using glob pathspec.

Also, add spec files (found in src/postgres/src/test/isolation) to the
list of excluded paths.

See related commit 5bf7c61.

Depends on D12395

Test Plan:
Jenkins: compile-only, build type: release, compiler: clang

    #!/usr/bin/bash
    # Get things up-to-date.
    ./yb_build.sh
    # Edit contrib regress test files.
    echo '# abc' >>src/postgres/contrib/hstore/yb_schedule
    git add src/postgres/contrib/hstore/yb_schedule
    echo '-- def' >>src/postgres/contrib/hstore/sql/hstore.sql
    echo '-- ghi' >>src/postgres/contrib/hstore/expected/hstore.out
    echo '# aaa' >>src/postgres/src/test/isolation/isolation_schedule
    echo '-- bbb' >>src/postgres/src/test/isolation/specs/async-notify.spec
    echo '-- ccc' >>src/postgres/src/test/isolation/expected/async-notify.out
    # Expect postgres build to get skipped (find "skipping the 'make' step.").
    ./yb_build.sh --skip-java

Reviewers: mbautin, steve.varnau

Reviewed By: steve.varnau

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D12397
  • Loading branch information
jaki committed Jul 27, 2021
1 parent ef2a9df commit 5528acf
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions python/yb/build_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,15 +537,18 @@ def get_build_stamp(self, include_env_vars: bool) -> str:
]
git_version = self.get_git_version()
if git_version and git_version >= semantic_version.Version('1.9.0'):
# Git version 1.9.0 allows specifying negative pathspec. Use it to exclude changes
# to regress test files not needed for build.
# Git version 1.8.5 allows specifying glob pathspec, and Git version 1.9.0 allows
# specifying negative pathspec. Use them to exclude changes to regress test files
# not needed for build.
pathspec.extend([
':(exclude)src/postgres/src/test/regress/*_schedule',
':(exclude)src/postgres/src/test/regress/data',
':(exclude)src/postgres/src/test/regress/expected',
':(exclude)src/postgres/src/test/regress/input',
':(exclude)src/postgres/src/test/regress/output',
':(exclude)src/postgres/src/test/regress/sql',
':(glob,exclude)src/postgres/**/*_schedule',
':(glob,exclude)src/postgres/**/data/*.csv',
':(glob,exclude)src/postgres/**/data/*.data',
':(glob,exclude)src/postgres/**/expected/*.out',
':(glob,exclude)src/postgres/**/input/*.source',
':(glob,exclude)src/postgres/**/output/*.source',
':(glob,exclude)src/postgres/**/specs/*.spec',
':(glob,exclude)src/postgres/**/sql/*.sql',
])
# Get the most recent commit that touched postgres files.
git_hash = subprocess.check_output(
Expand Down

0 comments on commit 5528acf

Please sign in to comment.