Skip to content

Commit a11effa

Browse files
committed
Really fix upm testing
1 parent b50c05d commit a11effa

File tree

6 files changed

+27
-18
lines changed

6 files changed

+27
-18
lines changed

.yamato/build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ build:
1111

1212
commands:
1313
- powershell scripts\Get-Deps.ps1
14-
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
1514
- build.cmd
1615
- test.cmd
17-
- pack.cmd -u
16+
- pack.cmd
1817

1918
artifacts:
2019
nuget:
2120
paths:
22-
- "build/nuget/**/*.nupkg"
21+
- "build/nuget/**/*nupkg"
2322
- "nuget.config"
2423
packman:
2524
paths:
@@ -33,4 +32,4 @@ build:
3332
- "tests/**/TestResults/*"
3433
sources:
3534
paths:
36-
- "build/upm/**/*"
35+
- "build/packages/**/*"

.yamato/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ publish_packman:
5252
commands:
5353
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
5454
{% for package in packages %}
55-
- upm-ci package publish --package-path build\upm\{{ package.name }}
55+
- upm-ci package publish --package-path build\packages\{{ package.name }}
5656
{% endfor %}
5757

5858
dependencies:

.yamato/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_{{ platform.name }}_{{ editor.version }}:
1212
commands:
1313
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
1414
{% for package in packages %}
15-
- upm-ci package test --package-path build\upm\{{ package.name }} -u {{editor.version}}
15+
- upm-ci package test --package-path build\packages\{{ package.name }} -u {{editor.version}}
1616
{% endfor %}
1717

1818
dependencies:

common/packaging.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<Target Name="EnumeratePackageFiles" Returns="@(SourcesToCopy)">
2626
<CreateItem
2727
Include="$(PackageSourceRootFull)**\*.*;$(RootDir)\extras\$(PackageName)\**\*.*"
28-
Exclude="$(PackageSourceRootFull)**\*.csproj*;$(PackageSourceRootFull)**\*.ncrunch*;$(PackageSourceRootFull)**\obj\**;$(PackageSourceRootFull)version.json*;$(PackageSourceRootFull)Tests\**;$(RootDir)\extras\$(PackageName)\Tests\**">
28+
Exclude="$(PackageSourceRootFull)**\*.csproj*;$(PackageSourceRootFull)**\*.ncrunch*;$(PackageSourceRootFull)**\obj\**;$(PackageSourceRootFull)version.json*;$(PackageSourceRootFull)Tests\**;$(RootDir)\extras\$(PackageName)\Tests\**;$(PackageSourceRootFull)Tests.meta">
2929
<Output TaskParameter="Include" ItemName="SourcesToCopy" />
3030
</CreateItem>
3131
</Target>

scripts/Pack-Upm.ps1

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,26 @@ $srcDir = Join-Path $rootDirectory 'src'
1717

1818
New-Item -itemtype Directory -Path $upmDir -Force -ErrorAction SilentlyContinue
1919

20+
# the loops I have to go throught to get upm to do the right thing...
2021
Get-ChildItem -Directory $srcDir | % {
2122
Write-Output "Packing $($_.Name)"
2223

24+
$pkgdir = Join-Path $upmDir $_.Name
25+
2326
$src = Join-Path $packagesDir $_.Name
2427
$target = $upmDir
2528
Copy-Item $src $target -Recurse -Force -ErrorAction SilentlyContinue
2629

27-
$packageDir = Join-Path $srcDir $_.Name
28-
$src = Join-Path $packageDir "Tests"
29-
$target = Join-Path $upmDir $_.Name
30-
Copy-Item $src $target -Recurse -Force -ErrorAction SilentlyContinue
31-
$src = Join-Path $packageDir "Tests.meta"
32-
$target = Join-Path $upmDir $_.Name
30+
$src = "$srcDir\$($_.Name)\Tests.meta"
31+
$target = $pkgdir
3332
Copy-Item $src $target -Force -ErrorAction SilentlyContinue
34-
$packageDir = Join-Path $upmDir $_.Name
35-
Invoke-Command -Fatal { & upm-ci package pack --package-path $packageDir }
33+
34+
$testsdir = Join-Path $pkgdir "Tests"
35+
New-Item -itemtype Directory -Path $testsdir -Force -ErrorAction SilentlyContinue
36+
37+
$src = "$packagesDir\$($_.Name).tests\*"
38+
$target = "$testsdir\"
39+
Copy-Item $src $target -Recurse -Force -ErrorAction SilentlyContinue
40+
41+
Invoke-Command -Fatal { & upm-ci package pack --package-path $pkgdir }
3642
}

src/com.unity.editor.tasks/Tests/Editor/UnityBaseTest.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,13 @@ internal SPath TestApp
110110
testApp = "Packages/com.unity.editor.tasks.tests/Helpers~/Helper.CommandLine.exe".ToSPath().Resolve();
111111
if (!testApp.Value.FileExists())
112112
{
113-
Debug.LogException(new InvalidOperationException(
114-
"Test helper binaries are missing. Build the UnityTools.sln solution once with `dotnet build` in order to set up the tests."));
115-
testApp = SPath.Default;
113+
testApp = "Packages/com.unity.editor.tasks.tests/Tests/Helpers~/Helper.CommandLine.exe".ToSPath().Resolve();
114+
if (!testApp.Value.FileExists())
115+
{
116+
Debug.LogException(new InvalidOperationException(
117+
"Test helper binaries are missing. Build the UnityTools.sln solution once with `dotnet build` in order to set up the tests."));
118+
testApp = SPath.Default;
119+
}
116120
}
117121
}
118122
}

0 commit comments

Comments
 (0)