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

[Test] Define broken/skip keyword argument for @test #39322

Merged
merged 2 commits into from
Apr 7, 2021

Conversation

giordano
Copy link
Contributor

They make it less tedious having tests failing consistently only under specific
conditions.

@giordano
Copy link
Contributor Author

Side note, I feel like @test_broken and @test_skip should have been

@test ... broken=true
@test ... skip=true

but that ship has sailed already. Maybe good for v2.0?

@oscardssmith
Copy link
Member

If we want that for 2.0, we should add the keyword version now so the ecosystem has plenty of time to transition.

@giordano
Copy link
Contributor Author

If there is consensus about adding broken/skip keywords to @test, I can look into that (not very soon though)

```jldoctest
julia> @test_broken_if true 2 + 2 == 5
Test Broken
Brokenped: 2 + 2 == 5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have absolutely no idea where this "Brokenped" was coming from 😳

@giordano giordano changed the title Add @test_broken_if and @test_skip_if macros [Test] Define broken/skip keyword argument for @test Feb 14, 2021
@giordano
Copy link
Contributor Author

I've updated the pull request to define the broken/skip keyword arguments for @test. I'll later update replace some occurrences of @test_broken/@test_skip in the test suite where the new form makes more sense

@giordano
Copy link
Contributor Author

giordano commented Mar 1, 2021

Bump 🙂

@vchuravy vchuravy added the triage This should be discussed on a triage call label Mar 9, 2021
stdlib/Test/src/Test.jl Outdated Show resolved Hide resolved
@miguelraz
Copy link
Contributor

Triage asks to add a NEWS.md item to show the broken=... (the tests under test/complex.jl would be nice).

@vtjnash vtjnash removed the triage This should be discussed on a triage call label Mar 11, 2021
@JeffBezanson JeffBezanson added testsystem The unit testing framework and Test stdlib needs news A NEWS entry is required for this change labels Mar 11, 2021
@JeffBezanson
Copy link
Member

Very nice feature!!

@giordano
Copy link
Contributor Author

I believe I addressed all comments from triage:

  • simplified the expression returned by @test, with a single copy of result
  • added a NEWS.md entry showing a simplified test from test/complex.jl

They make it less tedious having tests failing consistently only under specific
conditions.
@giordano
Copy link
Contributor Author

Bump 🙂 The failure on macOS is in Downloads, and looks unrelated (I think)

test/complex.jl Show resolved Hide resolved
@giordano
Copy link
Contributor Author

giordano commented Apr 7, 2021

Good to merge? 😃

@staticfloat staticfloat merged commit 76c1d1d into JuliaLang:master Apr 7, 2021
@giordano giordano deleted the mg/test-if branch April 7, 2021 19:06
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
…#39322)

* [Test] Define `broken`/`skip` keyword argument for `@test`

They make it less tedious having tests failing consistently only under specific
conditions.

* [Test] Use new `@test ... broken=cond` in some tests
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
…#39322)

* [Test] Define `broken`/`skip` keyword argument for `@test`

They make it less tedious having tests failing consistently only under specific
conditions.

* [Test] Use new `@test ... broken=cond` in some tests
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
…#39322)

* [Test] Define `broken`/`skip` keyword argument for `@test`

They make it less tedious having tests failing consistently only under specific
conditions.

* [Test] Use new `@test ... broken=cond` in some tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs news A NEWS entry is required for this change testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants