Giter VIP home page Giter VIP logo

Comments (3)

hhorak avatar hhorak commented on July 4, 2024 1

I meant something else here. Some function that we could use to run some important commands instead of running them and then checking the output. Such function could also log something useful. E.g. httpd-container uses:

function run() {
    cmd="$1"
    expected_res="${2:-0}"
    msg="${3:-Running command '$cmd'}"
    run_command "$cmd" "$expected_res" "$msg"
    res=$?
    test "$res" -eq "$expected_res" && res=0 || res=1
    ct_check_testcase_result $res
    return $res
}

Feel free to check also what rlRun from beakerlib does (the implementation is pretty complex, attached to many internals, so nothing we could steal, but might be taken as an inspiration): https://github.com/beakerlib/beakerlib/blob/a5f5610ed254e07edbe60ec695a0203e64e4fb24/src/testing.sh#L664-L756

I can also imagine that the arguments of this function would be logged to a specific file/variable and when the test case fails, we could return what commands were run, so it could help figuring out a reproducer. IOW, we would not get all the preparation steps, only the important commands.

I'm not saying we cannot live with this new function (we're fine without it till today), it could just make the test scripts a bit more clear and output likely more readable.

from container-common-scripts.

zmiklank avatar zmiklank commented on July 4, 2024

I think that this is now covered by ct_run_tests_from_testset.
Could we close this?

from container-common-scripts.

zmiklank avatar zmiklank commented on July 4, 2024

Thanks for explanation Honzo, now it makes sense to me and I agree. Let's leave this opened then.

from container-common-scripts.

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.