Skip to content

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Jan 7, 2025

The new "run-test-suite" composite action fetches the unit_test_data/script_assets_test.json file and sets the DIR_UNIT_TEST_DATA environment variable. This is required to run the script_tests/script_assets_test:

BOOST_AUTO_TEST_CASE(script_assets_test)
{
    // See src/test/fuzz/script_assets_test_minimizer.cpp for information on how to generate
    // the script_assets_test.json file used by this test.
    SignatureCache signature_cache{DEFAULT_SIGNATURE_CACHE_BYTES};


    const char* dir = std::getenv("DIR_UNIT_TEST_DATA");
    BOOST_WARN_MESSAGE(dir != nullptr, "Variable DIR_UNIT_TEST_DATA unset, skipping script_assets_test");
    if (dir == nullptr) return;
    auto path = fs::path(dir) / "script_assets_test.json";
    bool exists = fs::exists(path);
    BOOST_WARN_MESSAGE(exists, "File $DIR_UNIT_TEST_DATA/script_assets_test.json not found, skipping script_assets_test");
    if (!exists) return;

Please note that the only difference in the ctest command output is that the script_tests test takes longer to run. To observe the actual difference, bitcoin/bitcoin#31576 is required.

@hebasto hebasto force-pushed the 250107-ctest-action branch from f800906 to ba1ee0a Compare January 7, 2025 15:09
@hebasto hebasto merged commit 9aa3073 into main Jan 7, 2025
7 checks passed
@hebasto hebasto deleted the 250107-ctest-action branch January 7, 2025 16:12
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.

1 participant