From b71431238f12bde9202329b0e5a0bfb381bad8c5 Mon Sep 17 00:00:00 2001 From: Alaska Date: Wed, 2 Oct 2024 22:08:15 +1300 Subject: [PATCH 1/8] Update Commiting Test Data section to include build bot testing This commit updates the "Commiting Test Data" section to include information on how to test that your tests are working using the build bot before commiting the changes to main --- docs/handbook/testing/setup.md | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index a17dfcfb..ff81ef04 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -144,25 +144,36 @@ Ensure submodules are up to date. make update ``` -Commit test files to the main branch of the test data repository. +Commit new or modified test files to a new branch of the test data repository. ``` bash cd tests/data git checkout main -.. make any changes .. +git checkout -B add-x-tests +.. make your changes .. git commit testfile1 testfile2 +git push origin add-x-tests ``` -Commit changes in the Blender repository, including the updated `tests/data` submodule hash. +Commit changes to your fork of the Blender repository, including the updated +`tests/data` submodule hash, and create a pull request. ``` bash cd ../.. +git checkout -B add-x-tests git commit sourcefile1 sourcefile2 tests/data +git push me +.. then create a pull request from this branch .. ``` -Check everything is ok, and push to both repositories. +Ensure your tests pass on the build bot commenting `@blender-bot build`, +or `@blender-bot build +gpu` to also run GPU tests (these aren't tested +regularly, so some GPU tests you havn't modified may fail), in your pull request. + +If the tests pass, then push your changes in the test data repo to the +main branch, update your branch of the Blender repo to point to the updated tests, +then push your Blender chages to the main branch of the Blender repo. + ``` bash -cd tests/data -git push origin main -cd ../.. -git push origin main +TODO: Add commands? +I personally haven't done merging/squishing of branches into main so I'm not sure the correct approach here. ``` -- 2.30.2 From 70d7f6a88959139f0e2f0e32fa9e572dedd85e50 Mon Sep 17 00:00:00 2001 From: Alaska Date: Wed, 2 Oct 2024 22:50:23 +1300 Subject: [PATCH 2/8] Change comments to avoid incorrect syntax highlighting --- docs/handbook/testing/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index ff81ef04..3436280a 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -149,7 +149,7 @@ Commit new or modified test files to a new branch of the test data repository. cd tests/data git checkout main git checkout -B add-x-tests -.. make your changes .. +# make your changes git commit testfile1 testfile2 git push origin add-x-tests ``` @@ -161,7 +161,7 @@ cd ../.. git checkout -B add-x-tests git commit sourcefile1 sourcefile2 tests/data git push me -.. then create a pull request from this branch .. +# then create a pull request for this branch ``` Ensure your tests pass on the build bot commenting `@blender-bot build`, -- 2.30.2 From 22bb643c0aaa51cd15065c9f82dbf34ae1bfe06e Mon Sep 17 00:00:00 2001 From: Alaska Date: Wed, 2 Oct 2024 22:51:04 +1300 Subject: [PATCH 3/8] Change Blender branch name to make it unique from tests repo --- docs/handbook/testing/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index 3436280a..c1815e7c 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -158,9 +158,9 @@ Commit changes to your fork of the Blender repository, including the updated `tests/data` submodule hash, and create a pull request. ``` bash cd ../.. -git checkout -B add-x-tests +git checkout -B add-x-tests-blender git commit sourcefile1 sourcefile2 tests/data -git push me +git push me add-x-tests-blender # then create a pull request for this branch ``` -- 2.30.2 From ed1cef045a35fbf1ab78a72dee07162329b0d445 Mon Sep 17 00:00:00 2001 From: Alaska Date: Wed, 2 Oct 2024 22:56:57 +1300 Subject: [PATCH 4/8] Add commands for pushing to the main branch, and restructure that section --- docs/handbook/testing/setup.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index c1815e7c..5fc9b98f 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -166,14 +166,28 @@ git push me add-x-tests-blender Ensure your tests pass on the build bot commenting `@blender-bot build`, or `@blender-bot build +gpu` to also run GPU tests (these aren't tested -regularly, so some GPU tests you havn't modified may fail), in your pull request. +regularly, so some GPU tests you havn't modified may fail), in your +pull request. -If the tests pass, then push your changes in the test data repo to the -main branch, update your branch of the Blender repo to point to the updated tests, -then push your Blender chages to the main branch of the Blender repo. +If the tests pass, then you can push your changes in the test data +repository to the main branch. ``` bash -TODO: Add commands? -I personally haven't done merging/squishing of branches into main so I'm not sure the correct approach here. +cd tests/data +git checkout main +git merge --ff-only add-x-tests +git push origin main +``` + +Preferably straight after pushing the updated tests, update +your branch of the Blender repository to point to the updated tests, +and push your Blender changes to the main branch of the Blender repo. + +``` bash +cd ../.. +git commit tests/data +git checkout main +git merge --ff-only add-x-tests-blender +git push origin main ``` -- 2.30.2 From 0ac75420e928d9a09d8139798a9ce02431f2e99b Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 3 Oct 2024 01:31:54 +1300 Subject: [PATCH 5/8] Pull 'create a pull request' comment out of code block --- docs/handbook/testing/setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index 5fc9b98f..69f0579a 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -155,13 +155,13 @@ git push origin add-x-tests ``` Commit changes to your fork of the Blender repository, including the updated -`tests/data` submodule hash, and create a pull request. +`tests/data` submodule, and then +[create a pull request](/docs/handbook/contributing/pull_requests/#create-a-pull-request). ``` bash cd ../.. git checkout -B add-x-tests-blender git commit sourcefile1 sourcefile2 tests/data git push me add-x-tests-blender -# then create a pull request for this branch ``` Ensure your tests pass on the build bot commenting `@blender-bot build`, -- 2.30.2 From 4680e6182e5c074bd7851f7c438ec3eccf9c6d9c Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 3 Oct 2024 01:33:52 +1300 Subject: [PATCH 6/8] Mention merging a pull request with gitea --- docs/handbook/testing/setup.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index 69f0579a..cbb7fff1 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -179,13 +179,15 @@ git merge --ff-only add-x-tests git push origin main ``` -Preferably straight after pushing the updated tests, update -your branch of the Blender repository to point to the updated tests, -and push your Blender changes to the main branch of the Blender repo. +After pushing the updated tests, update your branch of the Blender repository +to point to the updated tests, and push your changes to the main branch of +the Blender repository, either through Gitea, or with `git`. ``` bash cd ../.. git commit tests/data +git push me add-x-tests-blender +# Pushing changes with git git checkout main git merge --ff-only add-x-tests-blender git push origin main -- 2.30.2 From b45503fe25dfb0342f177e9f9bb26b7fb3e9179d Mon Sep 17 00:00:00 2001 From: Alaska Date: Thu, 3 Oct 2024 02:25:42 +1300 Subject: [PATCH 7/8] Split build bot testing into a subsection --- docs/handbook/testing/setup.md | 68 ++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index cbb7fff1..0735b434 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -144,45 +144,73 @@ Ensure submodules are up to date. make update ``` -Commit new or modified test files to a new branch of the test data repository. +Commit test files to the main branch of the test data repository. ``` bash cd tests/data git checkout main +# Make your changes +git commit testfile1 testfile2 +``` + +Commit changes in the Blender repository, including the updated `tests/data` submodule hash. +``` bash +cd ../.. +git commit sourcefile1 sourcefile2 tests/data +``` + +Check everything is ok, and push to both repositories. +``` bash +cd tests/data +git push origin main +cd ../.. +git push origin main +``` + + +> NOTE: **Running your tests before committing to main** +> +> You should run your tests to make sure they pass before commiting them to main. +This can be done [locally](#running-tests), or if you want to test for platform differences, +can be done on the build bot using the +[Blender bot](https://projects.blender.org/infrastructure/blender-bot/src/branch/main/README.md). +The steps for testing on the build bot are as follows: +> +> Commit changes to the test data repository to a new branch rather than main. +``` bash +cd tests/data git checkout -B add-x-tests -# make your changes +# Make your changes git commit testfile1 testfile2 git push origin add-x-tests ``` - -Commit changes to your fork of the Blender repository, including the updated -`tests/data` submodule, and then -[create a pull request](/docs/handbook/contributing/pull_requests/#create-a-pull-request). +> +> Commit the `tests/data` submodule change to a branch of the Blender repository, +push the branch to your fork, +[create a pull request](/docs/handbook/contributing/pull_requests/#create-a-pull-request), +and comment on your pull request `@blender-bot build` to get the build bot to test the changes. +`@blender-bot build +gpu` can be used to trigger additional GPU tests (these aren't tested regularly, +so some GPU tests you haven't modified may fail). ``` bash cd ../.. git checkout -B add-x-tests-blender -git commit sourcefile1 sourcefile2 tests/data +git commit tests/data git push me add-x-tests-blender +# Create the pull request +# Comment `@blender-bot build` on your pull request ``` - -Ensure your tests pass on the build bot commenting `@blender-bot build`, -or `@blender-bot build +gpu` to also run GPU tests (these aren't tested -regularly, so some GPU tests you havn't modified may fail), in your -pull request. - -If the tests pass, then you can push your changes in the test data +> +> If the tests pass, then you can push your changes in the test data repository to the main branch. - ``` bash cd tests/data git checkout main git merge --ff-only add-x-tests git push origin main ``` - -After pushing the updated tests, update your branch of the Blender repository -to point to the updated tests, and push your changes to the main branch of -the Blender repository, either through Gitea, or with `git`. - +> +> After pushing the updated tests, update your branch of the Blender repository +to use the updated main `tests/data` submodule, and push your changes to the main +branch of the Blender repository, either through Gitea, or with `git`. ``` bash cd ../.. git commit tests/data -- 2.30.2 From c4347489a07f5c6a460c30575fa3c333f80d03eb Mon Sep 17 00:00:00 2001 From: Weizhen Huang Date: Mon, 7 Oct 2024 12:04:33 +0200 Subject: [PATCH 8/8] Remove some repeated information and split the PR step --- docs/handbook/testing/setup.md | 43 ++++++++++++---------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/docs/handbook/testing/setup.md b/docs/handbook/testing/setup.md index 0735b434..a606c32a 100644 --- a/docs/handbook/testing/setup.md +++ b/docs/handbook/testing/setup.md @@ -148,7 +148,7 @@ Commit test files to the main branch of the test data repository. ``` bash cd tests/data git checkout main -# Make your changes +.. make your changes .. git commit testfile1 testfile2 ``` @@ -167,57 +167,44 @@ git push origin main ``` -> NOTE: **Running your tests before committing to main** +> NOTE: **Make sure the tests pass before committing to main** > > You should run your tests to make sure they pass before commiting them to main. -This can be done [locally](#running-tests), or if you want to test for platform differences, -can be done on the build bot using the -[Blender bot](https://projects.blender.org/infrastructure/blender-bot/src/branch/main/README.md). +This can be done [locally](#running-tests), or using [Blender Bot](https://projects.blender.org/infrastructure/blender-bot/src/branch/main/README.md) from Gitea +to ensure they pass on all platforms. The steps for testing on the build bot are as follows: > -> Commit changes to the test data repository to a new branch rather than main. +> Commit changes in the `tests/data` repository to a new branch rather than main. ``` bash cd tests/data git checkout -B add-x-tests -# Make your changes +.. make your changes .. git commit testfile1 testfile2 git push origin add-x-tests ``` > -> Commit the `tests/data` submodule change to a branch of the Blender repository, -push the branch to your fork, -[create a pull request](/docs/handbook/contributing/pull_requests/#create-a-pull-request), -and comment on your pull request `@blender-bot build` to get the build bot to test the changes. -`@blender-bot build +gpu` can be used to trigger additional GPU tests (these aren't tested regularly, -so some GPU tests you haven't modified may fail). +> Commit the new `tests/data` submodule hash to your fork of the Blender repository. ``` bash cd ../.. git checkout -B add-x-tests-blender git commit tests/data git push me add-x-tests-blender -# Create the pull request -# Comment `@blender-bot build` on your pull request ``` +> [Create a pull request](/docs/handbook/contributing/pull_requests/#create-a-pull-request) from the +link printed in the console, +and comment `@blender-bot build` to get the build bot to test the changes. Alternatively, +`@blender-bot build +gpu` can be used to trigger additional GPU tests (these aren't tested regularly, +so some GPU tests you haven't modified may fail). > -> If the tests pass, then you can push your changes in the test data +> If the tests pass, then you can push your changes in the `tests/data` repository to the main branch. ``` bash cd tests/data git checkout main +# Use --ff-only to keep the submodule hash unchanged. git merge --ff-only add-x-tests git push origin main ``` > -> After pushing the updated tests, update your branch of the Blender repository -to use the updated main `tests/data` submodule, and push your changes to the main -branch of the Blender repository, either through Gitea, or with `git`. -``` bash -cd ../.. -git commit tests/data -git push me add-x-tests-blender -# Pushing changes with git -git checkout main -git merge --ff-only add-x-tests-blender -git push origin main -``` +> From the Gitea interface, merge the pull request you just created in the Blender repository. -- 2.30.2