jenkinsci / jenkinsci/junit-sql-storage-plugin

Unit test links 404 after switching to database backend for junit results

Open
#523 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7
Forks
13
Avg merge
11m
Merged PRs (30d)
4

Description

### Jenkins and plugins versions report

Environment


```text
Jenkins: 2.555.3
OS: Linux - 6.1.176
Java: 21.0.11 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
---
PrioritySorter:936.937.v5581d0b_2ccb_a_
amazon-ecs:1.49
antisamy-markup-formatter:173.v680e3a_b_69ff3
apache-httpcomponents-client-4-api:4.5.14-269.vfa_2321039a_83
apache-httpcomponents-client-5-api:5.6.2-199.vc3c04d033fcc
asm-api:9.10.1-216.va_9256d3b_844b_
authentication-tokens:1.144.v5ff4a_5ec5c33
aws-credentials:262.v0efb_28f71f94
aws-java-sdk-ec2:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-ecs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-efs:1.12.780-480.v4a_0819121a_9e
aws-java-sdk-minimal:1.12.780-480.v4a_0819121a_9e
aws-java-sdk2-core:2.42.33-70.vd69c0763fa_60
aws-java-sdk2-ec2:2.42.33-70.vd69c0763fa_60
aws-java-sdk2-secretsmanager:2.42.33-70.vd69c0763fa_60
aws-secrets-manager-credentials-provider:2.222.v376939a_9ffb_b
aws-secrets-manager-secret-source:2.87.v49cc86c50c3b_
azure-ad:692.vec873983b_f50
azure-credentials:426.v5627e6a_4c7a_7
azure-sdk:284.vb_4128d6c7561
azure-vm-agents:1105.vb_8a_2393410b_7
blueocean:1.27.25
blueocean-bitbucket-pipeline:1.27.25
blueocean-commons:1.27.25
blueocean-config:1.27.25
blueocean-core-js:1.27.25
blueocean-dashboard:1.27.25
blueocean-display-url:2.4.4
blueocean-events:1.27.25
blueocean-git-pipeline:1.27.25
blueocean-github-pipeline:1.27.25
blueocean-i18n:1.27.25
blueocean-jwt:1.27.25
blueocean-personalization:1.27.25
blueocean-pipeline-api-impl:1.27.25
blueocean-pipeline-editor:1.27.25
blueocean-pipeline-scm-api:1.27.25
blueocean-rest:1.27.25
blueocean-rest-impl:1.27.25
blueocean-web:1.27.25
bootstrap5-api:5.3.8-1048.va_c299057e35c
bouncycastle-api:2.30.1.84-291.v9f17b_21896e2
branch-api:2.1280.v0d4e5b_b_460ef
build-discarder:158.vce570d01ce4c
build-history-manager:1.16.0
build-timeout:1.40
build-user-vars-plugin:214.va_eed2ed849ca_
byte-buddy-api:1.18.11-247.v7217390533c4
caffeine-api:3.2.4-208.v7e2da_a_7db_82b_
checks-api:415.vf022234a_931d
cloud-stats:423.v63f017a_f582c
cloudbees-bitbucket-branch-source:937.3.6
cloudbees-folder:6.1100.ve9eed61d16c4
command-launcher:134.v025a_5fcf9dea_
commons-collections4-api:4.5.0-8.va_d5448ef9011
commons-lang3-api:3.20.0-109.ve43756e2d2b_4
commons-text-api:1.15.0-218.va_61573470393
configuration-as-code:2103.vd6f93c3e714a_
credentials:1506.v948b_b_b_7dec44
credentials-binding:728.v902a_273b_8947
dark-theme:652.vea_da_dfea_e769
database:309.vf39a_d78a_cb_e8
database-postgresql:146.vd1a_f70b_56e0e
display-url-api:2.217.va_6b_de84cc74b_
docker-commons:477.v289085a_b_6896
docker-workflow:634.vedc7242b_eda_7
downstream-build-cache:1.7
durable-task:686.v80ff80875b_82
ec2:2059.v05f9d511d7e5
echarts-api:6.1.0-1306.vcee1648c16a_4
eddsa-api:0.3.0.1-29.v67e9a_1c969b_b_
email-ext:2038.v7b_8817a_499d9
favorite:2.263.v941d21defef7
flyway-api:13.0.0-464.v46a_823fcf5a_6
font-awesome-api:7.3.1-1013.v0835a_879ec6d
git:5.10.1
git-client:6.6.1
github:1.47.0
github-api:1.330-492.v3941a_032db_2a_
github-branch-source:1967.1970.vd86979736546
gson-api:2.14.0-201.v8eefe5515533
handy-uri-templates-2-api:2.1.8-38.vcea_5d521d5f3
htmlpublisher:427.1
instance-identity:203.v15e81a_1b_7a_38
ionicons-api:94.vcc3065403257
jackson-annotations2-api:2.22-19.v10a_a_582ea_26e
jackson2-api:2.22.0-439.vb_b_43658d6176
jackson3-api:3.2.1-92.vd25c2e23c180
jakarta-activation-api:2.1.4-1
jakarta-mail-api:2.1.5-1
jakarta-xml-bind-api:4.0.9-19.v2b_a_5b_44d9a_1c
javax-activation-api:1.2.0-8
javax-mail-api:1.6.2-11
jaxb:2.3.9-143.v5979df3304e6
jenkins-design-language:1.27.25
jjwt-api:0.13.0-141.vd58b_a_9592b_6c
joda-time-api:2.14.2-193.v422b_efce56e0
jquery3-api:3.7.1-687.v68d468e40b_30
jsch:0.2.16-95.v3eecb_55fa_b_78
json-api:20260719-223.va_81f828cdb_58
json-path-api:3.0.0-218.vcd4dd1355de2
jsoup:1.22.2-95.vc5d00f1eb_42d
junit:1416.vd753e036de5e
junit-sql-storage:355.v9d5995fb_06a_5
lockable-resources:1539.v4db_b_fc1cc115
macstadium-orka:2.06-SNAPSHOT (private-a7214de9-connorjf-ssh)
mailer:534.v1b_36f5864073
matrix-auth:3.3
matrix-project:870.v9db_fcfc2f45b_
microsoft-graph-api:1.225181-2.v4b_0434d7d9c5
mina-sshd-api-common:2.17.1-187.v0341274c2905
mina-sshd-api-core:2.17.1-187.v0341274c2905
mina-sshd-api-scp:2.17.1-187.v0341274c2905
monitoring:2.8.0
multibranch-scan-webhook-trigger:1.0.11
netty-api:4.2.15.Final-27.va_a_7872799c63
node-iterator-api:72.vc90e81737df1
okhttp-api:5.3.2-200.vedb_720a_cf1f8
opentelemetry-api:1.54.1.102.v276c93ee966d
pipeline-build-step:599.v4b_67ea_11b_152
pipeline-graph-analysis:254.v0f63a_a_447dca_
pipeline-graph-view:963.v2a_b_019810b_e1
pipeline-groovy-lib:798.v5cc688825312
pipeline-input-step:560.v56198a_642157
pipeline-milestone-step:152.v6e22b_8cfc66c
pipeline-model-api:2.2291.v2934911987b_6
pipeline-model-definition:2.2291.v2934911987b_6
pipeline-model-extensions:2.2291.v2934911987b_6
pipeline-stage-step:345.va_96187909426
pipeline-stage-tags-metadata:2.2291.v2934911987b_6
plain-credentials:199.v9f8e1f741799
plugin-util-api:7.1341.v039f146993d9
postgresql-api:42.7.11-94.v50c5c1c8f3b_d
prism-api:1.30.0-741.v034eb_0b_0a_a_fa_
pubsub-light:1.19
purge-build-queue-plugin:125.v09ee2147746f
rebuild:338.va_0a_b_50e29397
resource-disposer:0.25
scm-api:728.vc30dcf7a_0df5
script-security:1402.1405.vc96e74964250
simple-queue:1.4.13
snakeyaml-api:2.5-149.v72471e9c6371
snakeyaml-engine-api:3.0.1-5.vd98ea_ff3b_92e
sse-gateway:1.29
ssh-credentials:372.va_250881b_08cd
ssh-slaves:3.1097.v868116049892
sshd:3.384.vc89b_5e138cf9
structs:362.va_b_695ef4fdf9
theme-manager:346.v06cca_64c6a_37
timestamper:1.30
token-macro:477.vd4f0dc3cb_cf1
trilead-api:2.284.v1974ea_324382
uno-choice:2.8.9
variant:70.va_d9f17f859e0
versioncolumn:400.v3c5c3004f31d
woodstox-core-api:7.2.1-6.v3718a_a_11f5c4
workflow-aggregator:608.v67378e9d3db_1
workflow-api:1413.v2ff1a_5e720fa_
workflow-basic-steps:1098.v808b_fd7f8cf4
workflow-cps:4350.vcc65d4958821
workflow-durable-task-step:1479.v56e587f413a_7
workflow-job:1571.1580.v18e46842c125
workflow-multibranch:821.vc3b_4ea_780798
workflow-scm-step:466.va_d69e602552b_
workflow-step-api:724.v538c2362b_dfb_
workflow-support:1015.v785e5a_b_b_8b_22
ws-cleanup:0.49
yet-another-build-visualizer:1.17

```

### What Operating System are you using (both controller, and any agents involved in the problem)?

Linux controller, no agent interaction

### Reproduction steps

1. Install your plugin and the Postgresql backend plugin
2. Enable them both and configure the database backend
3. Navigate to any Jenkins job that parses junit results (ours are multibranch pipelines if that matters)
4. Try to access test results through the various provided buttons/links on job run status page.
NOTE: This issue did not happen while using the EFS backend.

If you click the "Tests" link shown here, you 404.
Image
which causes a 404 on `*//testReport/` endpoint:
Image
The **individual test case** links do work as expected, but they have much longer endpoints, eg. `*//testReport/junit/(root)/SQL%20TESTS/BACKWARDSCOMPATIBILITYODBCTESTS_2/` - hiding error for privacy:

Image

From the status page side panel, we also have other alternative routes:

Image
The "Tests" button on the side panel also 404s. It foes to the same URL as the "Tests" link from earlier.

If we try to use the "Tests" button via Pipeline Overview (the official replacement for Blue Ocean) in newer Jenkins versions (although still an optional download afaik), it goes to the same broken URL as above.
Endpoint: `*/stages/`

Image

The only functional way to access ALL the test results on a single page is via Blue Ocean at the top "Tests" tab (also on side panel), which looks like this:

Image
This has a longer endpoint specifically for this UI, and I don't think it's needed here.

### Expected Results

Modifying an **individual test case** URL in the browser from above, if I remove the last segment and refresh, it shows the pages you'd expect:
`*//testReport/junit/(root)/SQL%20TESTS/`
Image
Same if I remove the last segment again:
`*//testReport/junit/(root)/`:

Image

As far as I know from before we switched to the DB backend, the Pipeline Overview UI should also just use the normal UI for these too. No weird URLS like in Blue Ocean.

### Actual Results

See repro steps above (sorry, it's late)

### Anything else?

I'm unsure if your plugin needs a fix or if it just exposed an issue in the UI plugins we use or a newer Jenkins version we're using. Let me know if I need to go complain somewhere else.

### Are you interested in contributing a fix?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the 404 from the job run's Tests links, especially the *//testReport/ endpoint, with the PostgreSQL backend enabled; compare it with the working individual test-case and Blue Ocean routes. Trace how the database backend and Jenkins test-report entry point handle these URLs, then verify that the standard Tests links render the aggregate report as shown in the expected-results examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, postgresql
Domain
backend, databases, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.