After you've run your tests, you may notice on your Sauce Labs dashboard that the test status is Complete, rather than Passed/Failed. On its own, Selenium doesn't have a way to interpret test results, but you can use our API to keep track of passing and failing jobs.
To do so, use the the update_job method in the Sauce Labs REST API after the test has run.
This logic should be part of your Test Automation Framework, so that
update_job will be called appropriately depending on whether the test passes or fails.
You can find examples for setting pass/fail status in Appium and Selenium tests at Saucelabs-sample-test-frameworks on GitHub.