Using Savon with SellerCloud

At work, we’re moving to a new sales/inventory/fulfillment platform called SellerCloud. Their API, while open, is SOAP-based, which means I had to learn something new to make this all work.

XML is evil, but here’s the final bit to get it really going:

client = Savon.client(wsdl: "", soap_header: {'AuthHeader' => {:@xmlns => "", 'UserName' => "user", 'Password' => "password", "ApplicationName" => "Test", "ApplicationVersion" => 1}}, log: true, env_namespace: :soap, pretty_print_xml: true)

Building a testing platform in Ruby/Sinatra

As I mentioned, we’re building a new testing system at my job. We’re both web people first, so for us, it makes sense to make something that can use web technologies to make the whole thing easier to work on.

We’re using Ruby, with the Sinatra gem (think a simplified Rails, and you’re close). The PXE image boots into the i3 window manager, and autostarts the testing script (which is plain Ruby outside the Sinatra bits).

The testing uses a few small utilities, like memtester, seeker ( a very small utility I found to test seeking), and Ruby to glue it all together.

Fun things I’ve learned:

1) Trying to parse output from a curses-based UI is not going to end well
1a) It’s OK to make the curses-based UI pop up on the screen as long as it’s for good reason
2) Ruby has really simple script forking, which means that I can the HDD and memory testing simultaneously
2a) Ruby has really simple script forking, which means, much to my chagrin, that no, splitting memory testing into four parts doesn’t make it go faster.
3) Ruby makes really nice glue for stuff like this
3a) I think I’m stuck, help.
4) Assuming that a device will pass a test, and only failing it if it doesn’t, is a perfectly viable strategy
4a) Don’t forget to actually mark it as failed.
5) Don’t overthink your plans — sometimes it’s best to figure out a basic plan and run with it.
5a) Don’t underthink your plans, either — that’ll come back to bite ya.