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

Add contrib/subtree test execution to CI builds #3349

Merged
merged 2 commits into from
Aug 10, 2021
Merged

Add contrib/subtree test execution to CI builds #3349

merged 2 commits into from
Aug 10, 2021

Conversation

vdye
Copy link

@vdye vdye commented Aug 5, 2021

Changes

  • Subtree tests run if (and only if) make test passes in Windows, Linux, and Mac build/test jobs
    • For platforms that run make test more than once in run-build-and-tests.sh, subtree tests are only run after the last execution of make test
    • Added "fail fast" exit 1 to run-build-and-tests.sh - otherwise, tests failing in make test wouldn't always fail the test execution (this might also be because I'm not great at bash scripting 😉)
  • contrib/subtree test target updated to invoke t/ directory all target (rather than test target)
    • Necessary to use the $DEFAULT_TEST_TARGET
    • Matches root test target behavior

Testing

Comment on lines 96 to 98
test: $(GIT_SUBTREE_TEST)
$(MAKE) -C t/ test
$(MAKE) -C t/ all

Choose a reason for hiding this comment

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

Is this just a bug in the existing makefile? Did make -C contrib/subtree test just not work before?

This might be a good one-liner to send upstream, even if we don't choose to do the rest of the change. I would split them into two commits, first this change, then the changes to ci/.

Copy link
Member

Choose a reason for hiding this comment

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

I think the idea here is that all defaults to running DEFAULT_TEST_TARGET, which is set to prove in the CI runs. And test is a different target.

An alternative I briefly considered was to call make twice: once to "build" git-subtree, and then the test run. But that would be rather ugly because the tests require the git-subtree file to be copied to ../.., which the test target does, thanks to the prerequisite $(GIT_SUBTREE_TEST).

In short: I concur with @derrickstolee that it would be best to split out the change to the Makefile, and the commit message should probably mention that we're aligning with how Git's top-level Makefile defines its own test target (it also calls $(MAKE) -C t/ all, and then also mention that we want to be able to call this make target in contrib/subtree in the CI runs, where DEFAULT_TEST_TARGET is defined as prove.

Copy link
Author

Choose a reason for hiding this comment

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

it would be best to split out the change to the Makefile

Sounds good! Depending on whether you'd like me to make the change or not, should changing the use of pre-clean be part of the same commit, or a separate one?

Copy link
Member

Choose a reason for hiding this comment

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

It can definitely be not only a separate commit, but an independent patch series. And nothing about that patch series would be urgent: since we lost Azure Pipelines' powerful analysis/statistics/UI for tests (see e.g. here), we do not actually care about the full test results to be maintained. We are only interested in them if anything fails. And since we only run the subtree tests if Git's own test suite passed, that desire is still addressed.

However, should we ever decide to always run the subtree tests (even if Git's test suite failed, in which we obviously would still want to fail the test, i.e. record the exit status indicating failure in some way), we would definitely need to get rid of the automatic pre-clean dependency.

For now, though, there is no point in holding this PR up, I think. It would be good to have it in -rc2 (I would probably reorder the picks and the merge somewhat, so that the Merge 'readme' commit still comes on top).

@dscho
Copy link
Member

dscho commented Aug 5, 2021

@vdye could you please also describe in the commit message that we are so interested in subtree because it is included in Git for Windows (as opposed to, say, pretty much everything else in contrib)?

@dscho
Copy link
Member

dscho commented Aug 5, 2021

Oh, and I think there is yet another snag: contrib/subtree/t/Makefile contains that pre-clean target that is apparently called as part of the prove target, and it completely wipes away the results from Git's regular regression tests... see https://github.com/git-for-windows/git/pull/3349/checks?check_run_id=3255131320#step:5:175

I am not sure that I like the sound of this. Granted, we currently call make test && make -C contrib/subtree test which means that we only run the subtree tests if the regular regression tests all passed, so we don't delete any logs of any failed tests here. But it feels icky nevertheless. Maybe we should simply do away with the pre-clean rule?

@vdye
Copy link
Author

vdye commented Aug 5, 2021

that pre-clean target that is apparently called as part of the prove target, and it completely wipes away the results from Git's regular regression tests

I wanted to avoid making changes that caused contrib/subtree to differ in functionality from the main t/ directory test target (since they seem intentionally mostly the same).

Maybe we should simply do away with the pre-clean rule?

If we did remove the pre-clean target, should it only be removed for prove? That would get us what we need for CI testing, while leaving the test target the same. In any case (removing it from prove and/or test), would you want it removed from just contrib/subtree/t/Makefile, or also from t/Makefile & t/perf/Makefile (and, downstream, contrib/scalar/t/Makefile)?

vdye added 2 commits August 5, 2021 19:14
The intention of this change is to align with how the top-level git
`Makefile` defines its own test target (which also internally calls
`$(MAKE) -C t/ all`). This change also ensures the consistency of
`make -C contrib/subtree test` with other testing in CI executions
(which rely on `$DEFAULT_TEST_TARGET` being defined as `prove`).

Signed-off-by: Victoria Dye <[email protected]>
Because `git subtree` (unlike most other `contrib` modules) is included as
part of the standard release of Git for Windows, its stability should be
verified as consistently as it is for the rest of git. By including the
`git subtree` tests in the CI workflow, these tests are as much of a gate to
merging and indicator of stability as the standard test suite.

Signed-off-by: Victoria Dye <[email protected]>
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

All my outstanding suggestions can definitely wait for their own patch series in the future. This is good to go!

@dscho dscho added this to the Next release milestone Aug 10, 2021
@dscho dscho merged commit 740222a into git-for-windows:main Aug 10, 2021
@vdye vdye deleted the feature/ci-subtree-tests branch August 10, 2021 21:40
dscho added a commit that referenced this pull request Aug 10, 2021
Add `contrib/subtree` test execution to CI builds
@dscho
Copy link
Member

dscho commented Aug 10, 2021

I wanted to avoid making changes that caused contrib/subtree to differ in functionality from the main t/ directory test target (since they seem intentionally mostly the same).

That makes sense, I just have a hunch that upstream might be amenable to adjust this so that contrib/subtree/ never removes the test results.

Maybe we should simply do away with the pre-clean rule?

If we did remove the pre-clean target, should it only be removed for prove? That would get us what we need for CI testing, while leaving the test target the same. In any case (removing it from prove and/or test), would you want it removed from just contrib/subtree/t/Makefile, or also from t/Makefile & t/perf/Makefile (and, downstream, contrib/scalar/t/Makefile)?

My favorite solution would be to keep it as a stand-alone target, but remove it as a dependency from all other rules. The point being: if you want to run the tests as part of CI, chances are that you already ran Git's own CI and want to preserve the test results.

But as I said, this can wait for another time.

dscho added a commit that referenced this pull request Aug 10, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 11, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 12, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 12, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 12, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 13, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 13, 2021
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Aug 13, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 13, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Aug 13, 2021
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 7, 2025
Add `contrib/subtree` test execution to CI builds
@dscho dscho mentioned this pull request Jan 7, 2025
dscho added a commit to dscho/git that referenced this pull request Jan 7, 2025
…tests

Add `contrib/subtree` test execution to CI builds
dscho added a commit to dscho/git that referenced this pull request Jan 7, 2025
…tests

Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 7, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 7, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 8, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 9, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 9, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Jan 17, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Jan 27, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Jan 27, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Jan 27, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Jan 27, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 27, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 28, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Jan 28, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 3, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 5, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 5, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 5, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Feb 5, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 6, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit that referenced this pull request Feb 6, 2025
Add `contrib/subtree` test execution to CI builds
git-for-windows-ci pushed a commit that referenced this pull request Feb 6, 2025
Add `contrib/subtree` test execution to CI builds
dscho added a commit to dscho/git that referenced this pull request Feb 6, 2025
…tests

Add `contrib/subtree` test execution to CI builds
dscho added a commit to dscho/git that referenced this pull request Feb 6, 2025
…tests

Add `contrib/subtree` test execution to CI builds
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