Clear old tests from the results page
Asked Answered
M

4

9

How do I clear old tests from the tests page in Sauce Labs?

I've got allot of noise on there from trying out stuff and I'd like to tidy it up.

In the long run there will be lots of uninteresting builds, I'd like to be able to archive\remove them so that it isn't difficult to find the significant test runs.

Mercedes answered 15/3, 2013 at 12:55 Comment(1)
Bump - I'd love an answer to this question, deleting tests would be insanely useful.Baylor
G
4

This is currently not possible in Saucelabs. See this forum post for reference: http://support.saucelabs.com/entries/23076777-I-to-delete-seesions-

these jobs stay in your account indefinitely, as we've found that users prefer to maintain the records for future reference (for example, in case something starts failing in the future that previously passed).

UPDATE In the meantime they made it possible to delete jobs and resources through their REST API: https://docs.saucelabs.com/reference/rest-api/#delete-job

Gatepost answered 20/9, 2013 at 7:55 Comment(2)
The argument that "we've found that users prefer to maintain the records for future reference" is just disingenuous. There's tons of reasons why users may not want to have their jobs stored indefinitely: clutter, organization, relevancy, security, confidentiality, etc. Can't understand why they don't let their paid customers delete old jobs. It's just so obvious and important.Marinamarinade
I agree. We'd like to delete a number of jobs that are using an old build numbering format, that is messing up the ordering. Saucelabs - could you let us delete unwanted jobs? And that's coming from another paid user.Guillemot
H
4

To quickly delete all your old SauceLabs jobs, you can use this command-line script:

SUN=$SAUCE_USERNAME; SAK=$SAUCE_ACCESS_KEY
curl -u $SUN:$SAK https://saucelabs.com/rest/v1/$SUN/jobs?format=csv \
      | perl -wpe 's/\r$//' \
      | xargs -I{} curl -u $SUN:$SAK -X DELETE "https://saucelabs.com/rest/v1/$SUN/jobs/{}"
Hurry answered 17/2, 2015 at 8:40 Comment(0)
D
2

Sauce Labs has recently (Spring 2014) added the capability to delete tests manually. If you go on the test details page, you'll see a big red button labeled "Delete" on the right side of the screen. Clicking it will delete the test.

There's a feature request in to allow you to delete multiple tests at the same time.

Deltoro answered 30/5, 2014 at 0:17 Comment(0)
T
1

Here you have another script using jq for the same job:

curl -s -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X GET "$SAUCE_API_BASE_URL/rest/v1/$SAUCE_USERNAME/jobs" \
  | jq '.[] | .id' \
  | xargs -I{} sh -c 'curl -s -o /dev/null -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" -X DELETE "$SAUCE_API_BASE_URL/rest/v1/$SAUCE_USERNAME/jobs/{}"'

note that: SAUCE_API_BASE_URL should look something like:
https://api.eu-central-1.saucelabs.com

Take into account that the GET jobs is not retrieving all your jobs, so you may need to re-run this script multiple times

Tommyetommyrot answered 10/1 at 10:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.