← Back to team overview

kubuntu-council team mailing list archive

[Merge] ~seb128/ubuntu-manual-tests:tracker_update_documentation into ubuntu-manual-tests:main

 

Sebastien Bacher has proposed merging ~seb128/ubuntu-manual-tests:tracker_update_documentation into ubuntu-manual-tests:main.

Requested reviews:
  Ubuntu Testcase Admins (ubuntu-testcase)

For more details, see:
https://code.launchpad.net/~seb128/ubuntu-manual-tests/+git/ubuntu-manual-tests/+merge/431834

Include some documentation. 

It's printed if the script is called with -h or without argument.

The text and layout could be improved for sure, and if anyone want to make it better please do (also feel free to commit, I don't care about the credit or being the author), but even in the current form it should help the next person who tries to use the script.

-- 
Your team Ubuntu Testcase Admins is requested to review the proposed merge of ~seb128/ubuntu-manual-tests:tracker_update_documentation into ubuntu-manual-tests:main.
diff --git a/tools/qa_tracker_update.pl b/tools/qa_tracker_update.pl
index 6448c67..7cd69fc 100644
--- a/tools/qa_tracker_update.pl
+++ b/tools/qa_tracker_update.pl
@@ -11,6 +11,7 @@ use Encode;
 use File::Path;
 use File::Basename;
 use Data::Dumper;
+use Getopt::Std;
 
 my $mech = WWW::Mechanize->new();
 
@@ -45,6 +46,25 @@ use open ':encoding(utf8)';
 #print "$programName - $path";
 #die;
 
+# declare the perl command line flags/options we want to allow
+my %options=();
+getopts("h", \%options);
+
+# test for the existence of the options on the command line.
+# in a normal program you'd do more than just print these.
+
+if (defined $options{h} || $#ARGV < 1) {
+    my $scriptname = basename($0);
+    print "usage: perl $scriptname DOMAIN TESTCASES\n\n";
+    print "example: perl $scriptname iso testcases/image/1310_Upgrade\n\n";
+    print "DOMAIN is defined by the server URL being 'http://DOMAIN$baseURL'\n\n";
+    print "TESTCASES is one of several testcase filenames to upload\n";
+    print "If the testcase filename starts by a number (NNNNN_<testname>) the corresponding test will be updated\n";
+    print "If it doesn't include a number it will create a new testcase on the server and assign it an ID\n\n";
+    print "The Ubuntu SSO credential can be stored in the script to avoid prompting\n";
+    exit;
+}
+
 #first argument is the domain
 my $domain = $ARGV[0];
 

Follow ups