Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 0/1 explicitly as the client expects it #6034

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Oct 29, 2024

t/ui/10-tests_overview.t was failing under perl 5.40:

# Subtest: job dependencies displayed on 'Test result overview' page
    ok 1 - job href is shown correctly
    not ok 2 - dependency is shown correctly

    #   Failed test 'dependency is shown correctly'
    #   at t/ui/10-tests_overview.t line 594.
    #          got: '1 parallel parent
    # dependency failed'
    #     expected: '1 parallel parent
    # dependency passed'

In newer perl versions booleans are preserved, and when Mojolicious sends JSON to the client, it will return it as true. To support both older and newer versions, we explicitly return 0 or 1.

t/ui/10-tests_overview.t was failing under perl 5.40:

    # Subtest: job dependencies displayed on 'Test result overview' page
        ok 1 - job href is shown correctly
        not ok 2 - dependency is shown correctly

        #   Failed test 'dependency is shown correctly'
        #   at t/ui/10-tests_overview.t line 594.
        #          got: '1 parallel parent
        # dependency failed'
        #     expected: '1 parallel parent
        # dependency passed'

In newer perl versions booleans are preserved, and when Mojolicious
sends JSON to the client, it will return it as true.
To support both older and newer versions, we explicitly return 0 or 1.
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.98%. Comparing base (b96e97b) to head (bc927f2).
Report is 7 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6034   +/-   ##
=======================================
  Coverage   98.98%   98.98%           
=======================================
  Files         395      395           
  Lines       39358    39358           
=======================================
  Hits        38958    38958           
  Misses        400      400           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mergify mergify bot merged commit a8824eb into os-autoinst:master Oct 29, 2024
46 checks passed
@perlpunk perlpunk deleted the fix-boolean branch October 29, 2024 21:46
os-autoinst-bot pushed a commit to os-autoinst-bot/openQA that referenced this pull request Oct 30, 2024
commit a8824eb
Merge: da5fbe6 bc927f2
Author:     mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
AuthorDate: Tue Oct 29 17:39:17 2024 +0000
Commit:     GitHub <[email protected]>
CommitDate: Tue Oct 29 17:39:17 2024 +0000

    Merge pull request os-autoinst#6034 from perlpunk/fix-boolean

    Return 0/1 explicitly as the client expects it
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.

3 participants