Skip to content

Skip mono/nuget C# integration tests on Ubuntu 26.04 - #22450

Draft
redsun82 wants to merge 1 commit into
mainfrom
redsun82-skip-mono-integration-tests-on-ubuntu-26-04
Draft

Skip mono/nuget C# integration tests on Ubuntu 26.04#22450
redsun82 wants to merge 1 commit into
mainfrom
redsun82-skip-mono-integration-tests-on-ubuntu-26-04

Conversation

@redsun82

Copy link
Copy Markdown
Contributor

We are adding a sparse Ubuntu 26.04 integration test slice in github/semmle-code (to catch breakage on upcoming runners early, the way the 22.04 slice does for the oldest supported one). Four C# tests fail there, and this is the fix for them.

Why

Mono is end-of-life and its apt repository only publishes packages up to Ubuntu 18.04 (vs-bionic). On 26.04 those packages are uninstallable, since their gtk2-era dependency chain (libgtk2.0-0, gnome-icon-theme, fsharp, ...) no longer resolves:

mono-complete : Depends: mono-runtime (= 6.12.0.200-0xamarin2+ubuntu1804b1) but it is not going to be installed
                Depends: referenceassemblies-pcl but it is not going to be installed
                ...

Without mono, the failures are silent rather than obvious:

  • the legacy packages.config restore needs nuget.exe under mono, so it produces no assemblies at all and Assemblies.ql returns an empty result
  • standalone_dependencies_no_framework no longer finds mono's framework assemblies, so the buildless extractor falls back to downloading microsoft.netframework.referenceassemblies.net481, turning 1 expected row into 242

What

_supports_mono_nuget() already exists precisely to exclude platforms where mono and nuget do not work, and already excludes macos-15/macos-26 for the same class of reason. This adds Ubuntu 26.04 to it, so the four tests are deselected instead of failing.

Verified by collection on both platforms (26.04 simulated by faking freedesktop_os_release):

platform collected
Ubuntu 24.04 28/28, unchanged
Ubuntu 26.04 24/28, the 4 mono tests deselected

Note for reviewers

This uses runs_on.ubuntu_26_04, which is added by the companion semmle-code PR. These pytest integration tests only ever run from semmle-code (no workflow in this repo invokes pytest, and runs_on is supplied by semmle-code's pytest/lib), so nothing here breaks on its own. But the submodule bump must land after the semmle-code selector, or collection will fail with an AttributeError.

Mono is end-of-life and its apt repository only ships Ubuntu 18.04 packages,
whose gtk2-era dependencies cannot be satisfied on 26.04. Without mono the
legacy `packages.config` restore silently yields nothing and the buildless
extractor falls back to downloading .NET Framework reference assemblies, so
these four tests fail rather than being skipped.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the C# label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant