Git Product home page Git Product logo

Comments (8)

chriscool avatar chriscool commented on July 29, 2024 1

Yeah, this should probably be explained better in the doc.

from sharness.

felipec avatar felipec commented on July 29, 2024

I think this behavior is intended. At least the git test suite does the same thing.

from sharness.

felipec avatar felipec commented on July 29, 2024

@jluebbe I think what you want is implemented in Git upstream with test_atexit. That's called truly unconditionally when the tests are done. Even if the test crashes.

from sharness.

LeSpocky avatar LeSpocky commented on July 29, 2024

Stumbled over the same thing. Documentation mismatches behavior! What fix would you prefer in a PR?

from sharness.

felipec avatar felipec commented on July 29, 2024

@LeSpocky What explained in my previous comment: port test_atexit from Junio's git so that can be used to specify actions that should be done at the end regardless if tests fail or not.

from sharness.

LeSpocky avatar LeSpocky commented on July 29, 2024

You mean this one? https://github.com/git/git/blob/master/t/test-lib-functions.sh#L1364

Thing is: final_cleanup is not present in upstream Git test suite, but according to sharness docs it serves the same purpose as test_atexit as far as I understand both docs. Or let me ask the other way round: what would be the purpose of final_cleanup after adding test_atexit in sharness? How would both differ and would it really be necessary to have two of them? The problem at hand for sharness here is: documentation mismatches behaviour. Either one has to be fixed.

from sharness.

felipec avatar felipec commented on July 29, 2024

You mean this one? https://github.com/git/git/blob/master/t/test-lib-functions.sh#L1364

No, this one: https://github.com/git/git/blob/master/t/test-lib-functions.sh#L1397

Thing is: final_cleanup is not present in upstream Git test suite, but according to sharness docs it serves the same purpose as test_atexit as far as I understand both docs.

I don't think so. One says it runs at unconditionally at the end of the test script, and the other unconditionally after all the tasks have been run. It's not the same.

Or let me ask the other way round: what would be the purpose of final_cleanup after adding test_atexit in sharness?

I don't know.

How would both differ and would it really be necessary to have two of them?

It's probably not necessary to have both of them. But I believe test_atexit can be added without removing final_cleanup.

Eventually we probably should get rid of final_cleanup as most people would want to use test_atexit instead. But we could live with both for a while.

from sharness.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.