Clear old tests from the results page - saucelabs

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.

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

To quickly delete all your old SauceLabs jobs, you can use this command-line recipe:
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/{}"

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.

Related

How to Delete a Phabricator Diff

I made a diff in Phabricator containing a config file with sensitive information. Usually I would be content with abandoning the diff, but I don't want anybody seeing my password (even after I change it)
I should have been more careful when making my commit but it has already been done.
Take a look at the ./bin/remove command:
NAME
remove - remove objects
SYNOPSIS
remove command [options]
Administrative tool for destroying objects permanently.
WORKFLOWS
destroy [options] object ...
Permanently destroy objects.
help [command]
Show this help, or workflow help for command.
log
Show a log of permanently destroyed objects.
Use help command for a detailed command reference.
Use --show-standard-options to show additional options.

Changing publisher name and URL

So, yeah, the form is saying:
Please contact the system administrator to change your publisher name
and I'm the system administrator for the project and I don't know what the hell am I doing. :)
I can change the name of the publisher but not the URL. I guess this also changes some URL in the dataset? Do I need to do the change with API or there is some GUI?
BTW. I'm using DGU package.
You should ssh to your server and run commands like this to change the name, and optionally the title too with the -t:
source /home/co/ckan/bin/activate && cd /vagrant/src/ckanext-dgu
python ../ckanext-dgu/ckanext/dgu/bin/publisher_rename.py $CKAN_INI highways-agency highways-england -t 'Highways England'
From: http://guidance.data.gov.uk/publisher_editing.html#rename-a-publisher
The problem is it can take a few minutes to rename and reindex all the datasets, so this often can't be done during a web request. Ideally someone would code this as a background task so this can still be done in the form. However in the meantime DGU implemented this command-line script to do it, hence the need for a sysadmin.

Unix scripting for servces to check

I am struggling to write a script to check a particular service running on my server and then send me mails.
So should this script be the part of bash profile so that its always running..
regards
rick
The .profile, .bashrc and friends will be run on login, so they are of no good use for background monitoring. Two solutions come to mind:
Either use cron to run your script at predefined intervals
Or make it loop and use your system's init environment (SysV, Upstart, SystemD, ...) to control it
My recommendation is to stick with cron - it even makes the mailing of results dead easy - just create output.

Nexus: How many artifacts do we have?

At work, we have been using Nexus OSS 1.8.0 for a few years now. Recently, I (as a Nexus admin) have been asked how many artifacts are in our instance. It's a very simple question, but I can't for the life of me find an answer anywhere:
I couldn't find it in Nexus' UI, Google or here;
Looking at Nexus' REST API, there is a search endpoint (two, actually, although data_index is now deprecated), which also returns how many results the query yielded (field totalCount), except that I haven't figured out how to just search for everything: providing an empty parameter yields a 400 response.
I provided a reasonable estimate of many artifacts we have, and that's good enough for now, but I had more work than I felt I should've had... Did anybody have the same problem?
Update:
I needed to know how many internal artifacts we have (as opposed to external dependencies from Maven Central and the like), so I ended up GET-ing:
http://<OUR-NEXUS>/service/local/lucene/search?q=*&repositoryId=<OUR-REPO>
for every hosted repository and adding up the totalCount fields.
For the full count, searching for q=* yielded too many results, so I ran:
find $PATH_TO_SONATYPE_HOME | grep sha1 | egrep -v 'nexus-maven-repository-index|repository-metadata|maven-metadata|\.pom\.sha1' | wc -l
But I'm still surprised this type of information isn't readily available...
Try the following:
find $PATH_TO_SONATYPE_HOME -name "*.jar" | wc -l
It will only count JAR artfacts but that normally accounts for the bulk of files stored in Nexus
What Mark suggested is ok, but if you count sha1 files instead, you'll get a more accurate count as nexus will create that file on upload of every artifact.

SSH into a shared text editor for phone screen code tests?

Is there a simple way to have someone ssh into a machine and edit a text file while I view text they are writing?
I am interested in using this for phone screen interviews. Basically, I would tell the candidate to ssh into a particular machine and edit/compile a source file to test programming ability. Ideally, I would like to see what they are typing in real time rather than only when they save.
Is there a simple solution for this?
screen is the solution to this conundrum; see the -x option to create a shared session. You can create the session beforehand and have the dialin [ :) ] account invoke screen -x -R to attach to it. (I habitually use screen -A -U -R -x.)
You could use GNU Screen's multiuser feature (also called session sharing). http://aperiodic.net/screen/multiuser
It might be easier to setup a VNC & watch them that way. TightVNC allows you to run a 'web' server that they can connect to via a browser. http://www.tightvnc.com/winst.php#start_java
I've had a nothing but good experiences using a Google Doc for this. Realtime updating and collaboration for both parties, realtime cursor positions and highlighting for both parties, and it's stored somewhere really easy to get to afterwards, with revision history.
No syntax highlighting or auto-formatting, however, but honestly it's fine without it.

Resources