Skip to content

Minor test fixes for arXiv#15100

Merged
Siedlerchr merged 2 commits intomainfrom
fix-arxiv
Feb 13, 2026
Merged

Minor test fixes for arXiv#15100
Siedlerchr merged 2 commits intomainfrom
fix-arxiv

Conversation

@koppor
Copy link
Member

@koppor koppor commented Feb 12, 2026

Quick wins to reduce the number of test failures at arXiv

Checklist

  • I own the copyright of the code submitted and I license it under the MIT license
  • [/] I manually tested my changes in running JabRef (always required)
  • [/] I added JUnit tests for changes (if applicable)
  • [/] I added screenshots in the PR description (if change is visible to the user)
  • [/] I added a screenshot in the PR description showing a library with a single entry with me as author and as title the issue number
  • [/] I described the change in CHANGELOG.md in a way that can be understood by the average user (if change is visible to the user)
  • [/] I checked the user documentation for up to dateness and submitted a pull request to our user documentation repository

@koppor koppor added component: fetcher automerge PR is tagged with that label will be merged if workflows are green labels Feb 12, 2026
@koppor koppor enabled auto-merge February 12, 2026 16:12
@qodo-free-for-open-source-projects
Copy link
Contributor

Review Summary by Qodo

Fix ArXiv fetcher tests and update URLs to HTTPS

🐞 Bug fix 🧪 Tests

Grey Divider

Walkthroughs

Description
• Update ArXiv URLs from HTTP to HTTPS protocol
• Fix test method naming and assertion logic
• Add missing import and TODO comments
• Fix special character encoding in test data
Diagram
flowchart LR
  A["ArXiv Fetcher"] -->|"Update URLs"| B["HTTP to HTTPS"]
  A -->|"Fix Tests"| C["Test Methods & Assertions"]
  A -->|"Add Comments"| D["TODO & Documentation"]
  C -->|"Rename Method"| E["noSupportsAuthorSearchWithLastFirstName"]
  C -->|"Fix Assertion"| F["assertEquals to assertNotEquals"]
Loading

Grey Divider

File Changes

1. jablib/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java 📝 Documentation +1/-0

Add TODO comment for query transformer refactoring

• Added TODO comment referencing ArXivQueryTransformer for future refactoring
• Comment indicates current author/title query building should be replaced with transformer

jablib/src/main/java/org/jabref/logic/importer/fetcher/ArXivFetcher.java


2. jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java 🐞 Bug fix +29/-25

Update URLs to HTTPS and fix test assertions

• Updated all ArXiv PDF URLs from http:// to https:// protocol (15+ occurrences)
• Fixed special character encoding: replaced escaped accents \\'e with proper Unicode é in
 abstract text
• Renamed test method from noSupportsAuthorSearchWithLastFirstName() to
 supportsAuthorSearchWithLastFirstName()
• Changed assertion from assertEquals(List.of(), result) to assertNotEquals(List.of(), result)
 to match corrected test intent
• Added missing import: assertNotEquals from JUnit assertions
• Added TODO comment about phrase search query error in supportsPhraseSearch() test
• Updated test URL parameter from http://arxiv.org/abs/1405.2249 to
 https://arxiv.org/abs/1405.2249

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java


Grey Divider

Qodo Logo

@testlens-app
Copy link

testlens-app bot commented Feb 12, 2026

✅ All tests passed ✅

🏷️ Commit: 42c2c0e
▶️ Tests: 9932 executed
⚪️ Checks: 52/52 completed


Learn more about TestLens at testlens.app.

@qodo-free-for-open-source-projects
Copy link
Contributor

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. HTTP URL test duplicated 🐞 Bug ✓ Correctness
Description
searchWithHttpUrl now uses an https URL, making it identical to searchWithHttpsUrl and removing
coverage for parsing http://arxiv.org/... identifiers. This can let regressions in http URL
parsing slip through unnoticed.
Code

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[R384-389]

    @Test
    void searchWithHttpUrl() throws FetcherException {
-        assertEquals(Optional.of(sliceTheoremPaper), fetcher.performSearchById("http://arxiv.org/abs/1405.2249"));
+        assertEquals(Optional.of(sliceTheoremPaper), fetcher.performSearchById("https://arxiv.org/abs/1405.2249"));
    }

    @Test
Evidence
Both tests now call performSearchById with the same https URL, while the identifier parser
explicitly supports http(s) prefixes, so the test suite should still exercise the http variant.

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[384-392]
jablib/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java[16-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`searchWithHttpUrl` no longer tests an `http://` URL and is now identical to `searchWithHttpsUrl`, reducing test coverage.

### Issue Context
`ArXivIdentifier.parse` explicitly supports both http and https URLs.

### Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[384-392]
- jablib/src/main/java/org/jabref/model/entry/identifier/ArXivIdentifier.java[16-23]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Weak author-search assertion 🐞 Bug ⛯ Reliability
Description
The renamed supportsAuthorSearchWithLastFirstName test now only asserts “non-empty result”, which
is much weaker than the existing supportsAuthorSearch test and can pass even if results don’t
match the intended authors. This reduces the test’s ability to catch regressions and can hide false
positives from the remote API.
Code

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[R174-178]

    @Test
-    void noSupportsAuthorSearchWithLastFirstName() throws FetcherException {
+    void supportsAuthorSearchWithLastFirstName() throws FetcherException {
        StringJoiner queryBuilder = new StringJoiner("\" AND author:\"", "author:\"", "\"");
        getTestAuthors().forEach(queryBuilder::add);
Evidence
supportsAuthorSearch validates that the returned BibEntries actually contain expected author
substrings, while the new/changed test only checks non-emptiness (`assertNotEquals(List.of(),
result)`), which does not validate correctness of the match.

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[153-185]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `supportsAuthorSearchWithLastFirstName` test only asserts non-empty results, which can pass with irrelevant matches and does not validate correctness.

### Issue Context
There is already a stronger pattern in `supportsAuthorSearch` that checks author content.

### Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[153-185]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

3. Brittle full-entry comparisons 🐞 Bug ⛯ Reliability
Description
Tests still assert full BibEntry equality (including the entire abstract and exact FILE value),
making them highly sensitive to minor upstream arXiv metadata/format changes (as shown by this PR
needing to update encoding and URL strings). This increases future test maintenance and risk of
“unrelated” CI failures when arXiv changes formatting.
Code

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[116]

+                .withField(StandardField.ABSTRACT, "A general slice theorem for the action of a Fréchet Lie group on a Fréchet manifolds is established. The Nash-Moser theorem provides the fundamental tool to generalize the result of Palais to this infinite-dimensional setting. The presented slice theorem is illustrated by its application to gauge theories: the action of the gauge transformation group admits smooth slices at every point and thus the gauge orbit space is stratified by Fréchet manifolds. Furthermore, a covariant and symplectic formulation of classical field theory is proposed and extensively discussed. At the root of this novel framework is the incorporation of field degrees of freedom F and spacetime M into the product manifold F * M. The induced bigrading of differential forms is used in order to carry over the usual symplectic theory to this new setting. The examples of the Klein-Gordon field and general Yang-Mills theory illustrate that the presented approach conveniently handles the occurring symmetries.")
Evidence
sliceTheoremPaper includes a long hard-coded abstract and is used in
assertEquals(List.of(sliceTheoremPaper), ...). Since BibEntry.equals compares the entire fields
map, any upstream change to any field (abstract punctuation/encoding, file URL scheme, keywords,
etc.) breaks the test even if core functionality still works.

jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[110-124]
jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[307-311]
jablib/src/main/java/org/jabref/model/entry/BibEntry.java[878-890]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Integration tests compare complete `BibEntry` objects against live arXiv metadata, which is brittle to minor upstream formatting/encoding changes.

### Issue Context
`BibEntry.equals` compares the full `fields` map. The test fixtures include large abstracts and URL strings.

### Fix Focus Areas
- jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[110-124]
- jablib/src/test/java/org/jabref/logic/importer/fetcher/ArXivFetcherTest.java[307-311]
- jablib/src/main/java/org/jabref/model/entry/BibEntry.java[878-890]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@koppor koppor added this pull request to the merge queue Feb 13, 2026
@github-actions github-actions bot added the status: to-be-merged PRs which are accepted and should go into the merge-queue. label Feb 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@Siedlerchr Siedlerchr added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 5e4f7cf Feb 13, 2026
53 checks passed
@Siedlerchr Siedlerchr deleted the fix-arxiv branch February 13, 2026 19:51
Siedlerchr added a commit to faneeshh/jabref that referenced this pull request Feb 14, 2026
* upstream/main:
  Refine Automatic Field Editor filtering logic (fixes JabRef#15066) (JabRef#15094)
  Output URL to workflow
  Fix token
  Refine stats message
  Quick fix to reduce load on runners
  "Debug" output for assign-issue-action
  Streamline pr-comment.yml (and remove status: stale label)
  Feature provide insights citation fetcher (JabRef#15093)
  Automatic Grouping By Entry Type (JabRef#15081)
  Minor test fixes for arXiv (JabRef#15100)
  New Crowdin updates (JabRef#15101)
  recomment linked files handler (JabRef#15105)
  Chore(deps): Bump jablib/src/main/resources/csl-styles (JabRef#15087)
  Streamline binaries (JabRef#15085)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge PR is tagged with that label will be merged if workflows are green component: fetcher status: to-be-merged PRs which are accepted and should go into the merge-queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants