Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
platform: x86_64
test-category: full
full-gpu-tests: true
runs-on: [Windows, self-hosted, "GCP-T4"]
runs-on: [Windows, self-hosted, GCP-T4]
has-gpu: true
server-count: 8
fail-fast: false
Expand Down Expand Up @@ -231,23 +231,12 @@ jobs:
-skip-reference-image-generation \
-show-adapter-info \
-enable-debug-layers false
elif [[ "${{matrix.has-gpu}}" == "true" ]]; then
"$bin_dir/slang-test" \
-use-test-server \
-category ${{ matrix.test-category }} \
-api all-dx12 \
-expected-failure-list tests/expected-failure-github.txt \
-expected-failure-list tests/expected-failure-github-runner.txt \
-skip-reference-image-generation \
-show-adapter-info \
-enable-debug-layers false
else
"$bin_dir/slang-test" \
-use-test-server \
-category ${{ matrix.test-category }} \
-api all-dx12 \
-expected-failure-list tests/expected-failure-github.txt \
-expected-failure-list tests/expected-failure-github-runner.txt \
-expected-failure-list tests/expected-failure-no-gpu.txt \
-skip-reference-image-generation \
-show-adapter-info \
-enable-debug-layers false
Expand Down Expand Up @@ -276,7 +265,7 @@ jobs:
-category ${{ matrix.test-category }} \
-emit-spirv-via-glsl \
-api vk \
-expected-failure-list tests/expected-failure.txt \
-expected-failure-list tests/expected-failure-via-glsl.txt \
-skip-reference-image-generation \
-show-adapter-info
- name: Run slang-rhi tests
Expand Down
1 change: 0 additions & 1 deletion tests/expected-failure-github-runner.txt

This file was deleted.

6 changes: 6 additions & 0 deletions tests/expected-failure-no-gpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
slang-unit-test-tool/RecordReplay_triangle.internal
slang-unit-test-tool/RecordReplay_ray_tracing.internal
slang-unit-test-tool/RecordReplay_ray_tracing_pipeline.internal
slang-unit-test-tool/RecordReplay_autodiff_texture.internal
slang-unit-test-tool/RecordReplay_gpu_printing.internal
slang-unit-test-tool/cudaCodeGenBug.internal
Copy link
Copy Markdown
Contributor

@gtong-nv gtong-nv Jun 18, 2025

Choose a reason for hiding this comment

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

These tests are still invoked even though they are expected to fail. Ideally we should have a way to skip tests.

File renamed without changes.
32 changes: 28 additions & 4 deletions tools/slang-test/slang-test-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,28 +949,48 @@ static Result _executeRPC(
JSONRPCConnection* rpcConnection = context->getOrCreateJSONRPCConnection();
if (!rpcConnection)
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: getOrCreateJSONRPCConnection()");
return SLANG_FAIL;
}

// Execute
if (SLANG_FAILED(rpcConnection->sendCall(method, rttiInfo, args)))
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: sendCall()");

context->destroyRPCConnection();
return SLANG_FAIL;
}

// Wait for the result
rpcConnection->waitForResult(context->connectionTimeOutInMs);
if (SLANG_FAILED(rpcConnection->waitForResult(context->connectionTimeOutInMs)))
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: waitForResult()");
}

if (!rpcConnection->hasMessage())
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: hasMessage()");

// We can assume somethings gone wrong. So lets kill the connection and fail.
context->destroyRPCConnection();
return SLANG_FAIL;
}

if (rpcConnection->getMessageType() != JSONRPCMessageType::Result)
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: getMessageType() != JSONRPCMessageType::Result");

context->destroyRPCConnection();
return SLANG_FAIL;
}
Expand All @@ -979,6 +999,10 @@ static Result _executeRPC(
TestServerProtocol::ExecutionResult exeRes;
if (SLANG_FAILED(rpcConnection->getMessage(&exeRes)))
{
context->getTestReporter()->messageFormat(
TestMessageType::RunError,
"JSON RPC failure: getMessage()");

context->destroyRPCConnection();
return SLANG_FAIL;
}
Expand Down Expand Up @@ -4780,8 +4804,8 @@ static SlangResult runUnitTestModule(
}

// If the test failed and it is not an expected failure, add it to the list of
// failed unit tests.
if (isFailed &&
// failed unit tests so that we can retry.
if (isFailed && !context->isRetry &&
!context->getTestReporter()->m_expectedFailureList.contains(test.testName))
{
std::lock_guard lock(context->mutexFailedTests);
Expand Down Expand Up @@ -5142,7 +5166,7 @@ SlangResult innerMain(int argc, char** argv)

int main(int argc, char** argv)
{
const SlangResult res = innerMain(argc, argv);
SlangResult res = innerMain(argc, argv);
slang::shutdown();
Slang::RttiInfo::deallocateAll();

Expand Down
10 changes: 10 additions & 0 deletions tools/slang-unit-test/unit-test-record-replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ static SlangResult runExample(
hashLines.add(line);
}

if (hashLines.getCount() == 0)
{
msgBuilder << "Hash value is not found for '" << exampleName << "'\n";
msgBuilder << "Process ret code: " << exeRes.resultCode << "\n";
msgBuilder << "Standard output:\n" << exeRes.standardOutput << "\n";
msgBuilder << "Standard error:\n" << exeRes.standardError << "\n";
getTestReporter()->message(TestMessageType::TestFailure, msgBuilder.toString().getBuffer());
return SLANG_FAIL;
}

res = parseHashes(hashLines, outHashes);
if (SLANG_FAILED(res))
{
Expand Down
Loading