Skip to content

Commit 9a317a6

Browse files
update
Correction... making a single PYTHON script that stays in alignment with our CI scripting language usage.
1 parent d288668 commit 9a317a6

7 files changed

Lines changed: 250 additions & 373 deletions

File tree

.yamato/_run-all.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -451,10 +451,8 @@ run_all_project_tests_cmb_service_default:
451451
run_all_api_updater_tests:
452452
name: Run All API Updater Tests
453453
dependencies:
454-
{% for platform in test_platforms.desktop -%}
455-
{% if platform.name == "win" -%}
454+
{% for platform in test_platforms.default -%}
456455
{% for editor in validation_editors.default -%}
457456
- .yamato/api-updater-test.yml#api_updater_test_{{ platform.name }}_{{ editor }}
458457
{% endfor -%}
459-
{% endif -%}
460458
{% endfor -%}

.yamato/api-updater-test.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
# develop_nightly or develop_weekly_trunk in _triggers.yml.
2020

2121
# CONFIGURATION STRUCTURE--------------------------------------------------------------
22-
# Windows only, and not looped over test_platforms: run-upgrade-test.ps1 is PowerShell and uses
23-
# robocopy to purge Library (paths there exceed MAX_PATH, which Remove-Item cannot delete).
22+
# Runs on the default platform (Ubuntu) like every other basic job. run_upgrade_test.py is Python, so
23+
# there is no platform constraint - the earlier PowerShell version forced a Windows agent because it
24+
# needed robocopy to purge Library past MAX_PATH.
2425
# A single editor is enough - the job is asserting on the editor's API updater, not on NGO
2526
# behaviour across editor versions. Widen to validation_editors.all if that stops being true.
2627

@@ -30,20 +31,19 @@
3031
# and needs no package-pack dependency.
3132
# The script restores the 2.x sources when it finishes, so the checkout is left unmodified and the
3233
# job is safe to re-run on the same agent.
33-
# -Clean purges Library first: the assertion is meaningless against a warm Library that already
34+
# --clean purges Library first: the assertion is meaningless against a warm Library that already
3435
# holds rewritten sources from a previous run.
3536

3637
# QUALITY CONSIDERATIONS--------------------------------------------------------------------
37-
# The expected type list in run-upgrade-test.ps1 is inline and hand-written. That is fine because
38+
# The expected type list in run_upgrade_test.py is inline and hand-written. That is fine because
3839
# its input is frozen: it enumerates the 2.x public editor API, and develop-2.0.0 is released.
3940
# TODO: the list does not extend itself. A later relocation within 3.x, or a back port into 2.x,
4041
# has to be added by hand or this job silently stops covering it. Deriving the list from the
4142
# [MovedFrom] attributes in the package source would close that.
4243

4344
#------------------------------------------------------------------------------------
4445

45-
{% for platform in test_platforms.desktop -%}
46-
{% if platform.name == "win" -%}
46+
{% for platform in test_platforms.default -%}
4747
{% for editor in validation_editors.default -%}
4848
api_updater_test_{{ platform.name }}_{{ editor }}:
4949
name : API Updater Test - NGO 2.x editor scripts upgrade [{{ platform.name }}, {{ editor }}]
@@ -53,13 +53,12 @@ api_updater_test_{{ platform.name }}_{{ editor }}:
5353
flavor: {{ platform.flavor }}
5454
commands:
5555
- unity-downloader-cli --fast --wait -u {{ editor }} -c Editor # Installing basic editor for the import
56-
- powershell -NoProfile -ExecutionPolicy Bypass -File apiupdaterproject/run-upgrade-test.ps1 -UnityExe .Editor/Editor/Unity.exe -Clean
56+
- python apiupdaterproject/run_upgrade_test.py --unity .Editor/Editor/Unity --clean
5757
artifacts:
5858
logs:
5959
paths:
6060
- "apiupdaterproject/upgrade-test.log"
6161
dependencies:
6262
- .yamato/_run-all.yml#run_quick_checks # initial checks to perform fast validation of common errors
6363
{% endfor -%}
64-
{% endif -%}
6564
{% endfor -%}

apiupdaterproject/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ what it is and how to run it; this file covers why it is built this way and what
1313
`com.unity.netcode.gameobjects/Editor/**`. This project only consumes them.
1414
* **Do not "fix" the sources under `Assets/Editor`.** They are deliberately written against the 2.x
1515
API and are the input to the test. A helpful cleanup there silently guts it.
16-
* The expected-type list in the run scripts is frozen: it enumerates the public editor API of
16+
* The expected-type list in `run_upgrade_test.py` is frozen: it enumerates the public editor API of
1717
`develop-2.0.0`, which is released and cannot change. It only needs extending if a public editor
1818
type is relocated again within 3.x.
1919
* CI runs it on demand only — comment `/ci apiupdater` on a PR. See `.yamato/api-updater-test.yml`.

apiupdaterproject/README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,28 @@ resolved transport version.
3939

4040
## Running it locally
4141

42-
The script imports the project in batch mode with `-accept-apiupdate`, then asserts that every 2.x
43-
type reference under `Assets/Editor` was rewritten and that none survived. It restores the 2.x
44-
sources when it finishes, so it can be re-run.
45-
46-
| Option | |
47-
| --- | --- |
48-
| editor path | Omit it if `UNITY_EDITOR_PATH` is set, or if the hub has the version named in `ProjectSettings/ProjectVersion.txt`. |
49-
| keep updated sources | Leaves the rewritten sources in place so `git diff` shows exactly what the updater produced. |
50-
| clean | Purges `Library` and `Temp` first for a cold import. |
51-
52-
### Windows
53-
54-
```powershell
55-
.\run-upgrade-test.ps1 -UnityExe "C:\Program Files\Unity\Hub\Editor\<version>\Editor\Unity.exe" -KeepUpdatedSources -Clean
56-
```
57-
58-
### macOS
59-
60-
The editor binary lives inside the `.app` bundle, not next to it.
42+
`run_upgrade_test.py` imports the project in batch mode with `-accept-apiupdate`, then asserts that
43+
every 2.x type reference under `Assets/Editor` was rewritten and that none survived. It restores the
44+
2.x sources when it finishes, so it can be re-run. Windows, macOS and Linux.
6145

6246
```sh
63-
./run-upgrade-test.sh --unity "/Applications/Unity/Hub/Editor/<version>/Unity.app/Contents/MacOS/Unity" --keep-updated-sources --clean
47+
python run_upgrade_test.py --unity <editor> --clean --keep-updated-sources
6448
```
6549

66-
### Linux
50+
| Option | |
51+
| --- | --- |
52+
| `--unity` | Omit it if `UNITY_EDITOR_PATH` is set, or if the hub has the version named in `ProjectSettings/ProjectVersion.txt`. |
53+
| `--clean` | Purges `Library` and `Temp` first for a cold import. |
54+
| `--keep-updated-sources` | Leaves the rewritten sources in place so `git diff` shows exactly what the updater produced. |
6755

68-
```sh
69-
./run-upgrade-test.sh --unity "$HOME/Unity/Hub/Editor/<version>/Editor/Unity" --keep-updated-sources --clean
70-
```
56+
Default hub locations, if you need to pass `--unity` explicitly — note that on macOS the binary is
57+
inside the `.app` bundle rather than beside it:
58+
59+
| | |
60+
| --- | --- |
61+
| Windows | `C:\Program Files\Unity\Hub\Editor\<version>\Editor\Unity.exe` |
62+
| macOS | `/Applications/Unity/Hub/Editor/<version>/Unity.app/Contents/MacOS/Unity` |
63+
| Linux | `$HOME/Unity/Hub/Editor/<version>/Editor/Unity` |
7164

7265

7366
## How the migration works

apiupdaterproject/run-upgrade-test.ps1

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)