[STUD-79858]: Publish runtime tests under separate pipeline artifact#552
Open
alexandru-petre wants to merge 1 commit into
Open
[STUD-79858]: Publish runtime tests under separate pipeline artifact#552alexandru-petre wants to merge 1 commit into
alexandru-petre wants to merge 1 commit into
Conversation
The runtime tests .nupkg was being published under the same "Packages" artifact name as the activity .nupkg, leaking into the published artifacts list. Publish it to a separate "RuntimeTestsPackages" artifact that only the downstream test-runner jobs consume. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
This PR separates runtime-test NuGet packages from the release package artifact in the shared Activities Azure Pipelines templates, preventing internal test packages from being published under the Packages artifact.
Changes:
- Publishes packed runtime-test projects as
RuntimeTestsPackages. - Updates Windows and Portable runtime-test jobs to download
RuntimeTestsPackages. - Leaves the upstream activity package download from
Packagesunchanged.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Activities/.pipelines/jobs/stage.build.runtime.tests.yml |
Publishes packed runtime-test packages under the new RuntimeTestsPackages artifact name. |
Activities/.pipelines/jobs/stage.run.runtime.tests.windows.yml |
Downloads runtime-test packages from RuntimeTestsPackages for Windows test execution. |
Activities/.pipelines/jobs/stage.run.runtime.tests.portable.yml |
Downloads runtime-test packages from RuntimeTestsPackages for Portable test execution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Context
The Community Activities solution ships per-package Azure Pipelines that build the activity, build a runtime-tests Studio project that consumes the freshly-built package, and run those tests on Windows / Portable target frameworks. The three relevant stage templates live in
Activities/.pipelines/jobs/and are shared between the Python, Database, and Cryptography packs. The Build stage publishes the activity.nupkgas a pipeline artifact namedPackages; the Runtime-Tests stage builds a Studio project against that nupkg, packs the resulting test project, and publishes it for the downstream Run stages to consume.Problem Statement
The runtime-tests
.nupkg(e.g.UiPath.Python.RuntimeTests_windows.<version>.nupkg) was being published under the samePackagesartifact name the Build stage uses for the activity.nupkg. The final published artifact list therefore contained both the activity package and an internal test package that should never ship — observable on every Python pipeline run, and incidentally on Database/Cryptography runs whenever those pipelines exercise the runtime-tests stage.Analysis
stage.build.runtime.tests.ymlends with aPublishBuildArtifacts@1step that named its outputPackages. Azure Pipelines merges artifacts that share a name, so the Studio-packed test nupkg was being appended to the existingPackagesartifact alongside the activity nupkg. The two consumer templates (stage.run.runtime.tests.windows.yml,stage.run.runtime.tests.portable.yml) then downloaded the mergedPackagesartifact and selected the test nupkg via a*_windows*/*_portable*glob, so the collision was invisible to the test pipeline itself but very visible in the final artifact list.The fix is to give the test nupkg its own artifact name and point the two consumers at the new name. Line 40 of
stage.build.runtime.tests.ymldeliberately keepsartifact: "Packages"— that one is the download of the activity nupkg from the upstream Build stage and must continue to read fromPackages.Behavior Before This PR
A Python pipeline run produces a single
Packagesartifact containing bothUiPath.Python.Activities.<version>.nupkg(correct) andUiPath.Python.RuntimeTests_windows.<version>.nupkg(internal, should not ship). Downstream consumers of the artifact list see the test nupkg as if it were a release artifact.Behavior After This PR
The same run produces two artifacts:
Packagescontains onlyUiPath.Python.Activities.<version>.nupkg;RuntimeTestsPackagescontains the*_windows*.nupkg(and*_portable*.nupkgwhen applicable). The Run-Tests Windows / Portable stages download fromRuntimeTestsPackagesand continue to select their nupkg via the existing target-framework glob, so test behavior is unchanged.Considered Use Cases
PerformDatabaseTestsenabled — same shared templates, same fix applied incidentally.condition: falsetoday, so the Windows run is the only realistic consumer there.BuildRuntimeTestsjob's download of the activity nupkg (line 40) must continue to read from the upstreamPackagesartifact — verified untouched.Implementation
Three single-line YAML changes, all in
Activities/.pipelines/jobs/:stage.build.runtime.tests.yml—PublishBuildArtifacts@1step:ArtifactName: "Packages"→"RuntimeTestsPackages".stage.run.runtime.tests.windows.yml—DownloadPipelineArtifact@2step:artifact: "Packages"→"RuntimeTestsPackages".stage.run.runtime.tests.portable.yml—DownloadPipelineArtifact@2step:artifact: "Packages"→"RuntimeTestsPackages".The download of the activity nupkg at line 40 of
stage.build.runtime.tests.ymlis intentionally not changed — it reads from the upstream Build stage'sPackagesartifact, which is unrelated to the leak.Caveats / Potential Issues
The shared template is also consumed by the Database and Cryptography pipelines, so the fix lands in all three packs symmetrically. This is intentional and not a regression — the same leak existed in those pipelines whenever their runtime-tests stages ran. In practice those stages are usually gated off (
PerformDatabaseTestsdefaults to false; Cryptography portable hascondition: false), so the behavior change is low-risk.How to Test
On the first pipeline run after merge: