Skip to content

Fix/purl test no UI redirect#42

Closed
alexskr wants to merge 2 commits intomasterfrom
fix/purl-test-no-ui-redirect
Closed

Fix/purl test no UI redirect#42
alexskr wants to merge 2 commits intomasterfrom
fix/purl-test-no-ui-redirect

Conversation

@alexskr
Copy link
Member

@alexskr alexskr commented Jul 28, 2025

Avoid following PURL redirects and split PURL tests into a separate file

  • Updated PURL-related tests to assert only the HTTP 302 status and Location header,
    without following the redirect to the BioPortal UI. This avoids triggering
    Cloudflare bot protection during CI runs.

  • We do not want to test UI behavior here — we only verify that the
    correct redirect is served by the PURL resolver. Testing how the UI handles or
    rewrites URLs (e.g., with query parameters or concept ID fragments) is out of scope
    for these tests.

  • Split PURL resolution tests into a new file test_class_purl.rb to separate
    concerns from core class model tests in test_class.rb

    Resolves Unit test fails in GitHub Actions due to Cloudflare bot protection — proposal to test only PURL redirect header #41

mdorf and others added 2 commits July 18, 2024 10:54
…te file

- Updated PURL-related tests to assert only the HTTP 302 status and Location header,
  without following the redirect to the BioPortal UI. This avoids triggering
  Cloudflare bot protection during CI runs.
- We do not want to test UI behavior here — we only verify that the
  correct redirect is served by the PURL resolver. Testing how the UI handles or
  rewrites URLs (e.g., with query parameters or concept ID fragments) is out of scope
  for these tests.
- Split PURL resolution tests into a new file `test_class_purl.rb` to separate
  concerns from core class model tests in `test_class.rb`.
@alexskr alexskr closed this Jul 28, 2025
@alexskr alexskr deleted the fix/purl-test-no-ui-redirect branch July 28, 2025 23:36
@jvendetti
Copy link
Member

We do not want to test UI behavior here — we only verify that the
correct redirect is served by the PURL resolver. Testing how the UI handles or
rewrites URLs (e.g., with query parameters or concept ID fragments) is out of scope
for these tests.

I'm not sure I'm following this comment. These unit tests weren't added to test UI behavior. They were added because the purl method in this library was (in some cases) generating invalid PURLs that resulted in 404 errors. See this comment for more details. The fix had to be applied to the code in this library, hence the new unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unit test fails in GitHub Actions due to Cloudflare bot protection — proposal to test only PURL redirect header

3 participants