Index: lnt/trunk/docs/importing_data.rst =================================================================== --- lnt/trunk/docs/importing_data.rst +++ lnt/trunk/docs/importing_data.rst @@ -21,7 +21,7 @@ echo -n "foo.exec 25\nbar.score 24.2\nbar/baz.size 110.0\n" > results.txt lnt importreport --machine=my-machine-name --order=1234 --testsuite=nts results.txt report.json - lnt submit http://mylnt.com/default/submitRun --commit report.json + lnt submit http://mylnt.com/default/submitRun report.json .. _json_format: Index: lnt/trunk/docs/quickstart.rst =================================================================== --- lnt/trunk/docs/quickstart.rst +++ lnt/trunk/docs/quickstart.rst @@ -111,7 +111,7 @@ Once you have a local instance, you can either submit results directly with:: - lnt import --commit=1 ~/myperfdb SANDBOX/test-/report.json + lnt import ~/myperfdb SANDBOX/test-/report.json or as part of a run with:: Index: lnt/trunk/docs/tests.rst =================================================================== --- lnt/trunk/docs/tests.rst +++ lnt/trunk/docs/tests.rst @@ -160,7 +160,7 @@ directory. This report can now be submitted directly to an LNT server. For example, if we have a local server running as described earlier, we can run:: - $ lnt submit --commit http://localhost:8000/submitRun \ + $ lnt submit http://localhost:8000/submitRun \ /tmp/BAR/test-2010-04-17_23-46-40/report.json STATUS: 0 Index: lnt/trunk/docs/tools.rst =================================================================== --- lnt/trunk/docs/tools.rst +++ lnt/trunk/docs/tools.rst @@ -27,15 +27,11 @@ ``lnt importreport []`` Convert text based key value pairs into a LNT json report file. - ``lnt submit [--commit] +`` + ``lnt submit +`` Submits one or more files to the given server. The ```` should be the url to the actual ``submitRun`` page on the server; the database being submitted to is effectively a part of this URL. - By default, this only submits the report to the server but does not actually - commit the data. When testing, you should verify that the server returns an - acceptable response before committing runs. - ``lnt showtests`` List available built-in tests. See the :ref:`tests` documentation for more details on this tool. @@ -109,7 +105,7 @@ The default server will have a sqlite3 database named *default*. You can specify to use PostgreSQL using ``--db-dir postgresql://user@hostname``. - ``lnt import [--commit] +`` + ``lnt import +`` Import an LNT data file into a database. You can use ``--database`` to select the database to write to. Note that by default this will also generate report emails if enabled in the configuration, you can use Index: lnt/trunk/lnt/lnttool/common.py =================================================================== --- lnt/trunk/lnt/lnttool/common.py +++ lnt/trunk/lnt/lnttool/common.py @@ -4,8 +4,8 @@ def submit_options(func): - func = click.option("--commit", is_flag=True, - help="actually commit the data")(func) + func = click.option("--commit", type=int, help="deprecated/ignored option", + expose_value=False)(func) func = click.option("--update-machine", is_flag=True, help="Update machine fields")(func) func = click.option("--merge", default="replace", show_default=True, Index: lnt/trunk/lnt/lnttool/import_data.py =================================================================== --- lnt/trunk/lnt/lnttool/import_data.py +++ lnt/trunk/lnt/lnttool/import_data.py @@ -23,7 +23,7 @@ @submit_options def action_import(instance_path, files, database, output_format, show_sql, show_sample_count, show_raw_result, testsuite, verbose, - quiet, no_email, no_report, commit, update_machine, merge): + quiet, no_email, no_report, update_machine, merge): """import test data into a database""" import contextlib import lnt.server.instance @@ -47,9 +47,8 @@ for file_name in files: result = lnt.util.ImportData.import_and_report( config, database, db, file_name, - output_format, testsuite, commit, show_sample_count, - no_email, no_report, updateMachine=update_machine, - mergeRun=merge) + output_format, testsuite, show_sample_count, no_email, + no_report, updateMachine=update_machine, mergeRun=merge) success &= result.get('success', False) if quiet: Index: lnt/trunk/lnt/lnttool/main.py =================================================================== --- lnt/trunk/lnt/lnttool/main.py +++ lnt/trunk/lnt/lnttool/main.py @@ -94,7 +94,7 @@ lnt.server.config.Config.dummy_instance()) for file in files: result = lnt.util.ImportData.import_and_report( - None, None, db, file, '', testsuite, commit=True) + None, None, db, file, '', testsuite) lnt.util.ImportData.print_report_result(result, sys.stdout, sys.stderr, verbose=True) @@ -181,19 +181,12 @@ @submit_options @click.option("--verbose", "-v", is_flag=True, help="show verbose test results") -def action_submit(url, files, commit, update_machine, merge, verbose): +def action_submit(url, files, update_machine, merge, verbose): """submit a test report to the server""" from lnt.util import ServerUtil import lnt.util.ImportData - if commit: - commit = True - else: - commit = False - logger.warning("submit called without --commit, " + - "your results will not be saved at the server.") - - files = ServerUtil.submitFiles(url, files, commit, verbose, + files = ServerUtil.submitFiles(url, files, verbose, updateMachine=update_machine, mergeRun=merge) for submitted_file in files: @@ -492,42 +485,30 @@ @click.group(invoke_without_command=True, no_args_is_help=True) @click.option('--version', is_flag=True, callback=show_version, expose_value=False, is_eager=True, help=show_version.__doc__) -def cli(): +def main(): """LNT command line tool \b Use ``lnt --help`` for more information on a specific command. """ -cli.add_command(action_check_no_errors) -cli.add_command(action_checkformat) -cli.add_command(action_convert) -cli.add_command(action_create) -cli.add_command(action_import) -cli.add_command(action_importreport) -cli.add_command(action_profile) -cli.add_command(action_runserver) -cli.add_command(action_send_daily_report) -cli.add_command(action_send_run_comparison) -cli.add_command(action_showtests) -cli.add_command(action_submit) -cli.add_command(action_update) -cli.add_command(action_updatedb) -cli.add_command(action_view_comparison) -cli.add_command(group_admin) -cli.add_command(group_runtest) - - -def main(): _version_check() - # Change deprecated `--commit=1` and `--commit 1` options to new ones. - for i in range(1, len(sys.argv)): - arg = sys.argv[i] - if arg == '--commit=1': - sys.argv[i] = '--commit' - if arg == '--commit' and i+1 < len(sys.argv) and sys.argv[i+1] == '1': - del sys.argv[i+1] - break - cli() +main.add_command(action_check_no_errors) +main.add_command(action_checkformat) +main.add_command(action_convert) +main.add_command(action_create) +main.add_command(action_import) +main.add_command(action_importreport) +main.add_command(action_profile) +main.add_command(action_runserver) +main.add_command(action_send_daily_report) +main.add_command(action_send_run_comparison) +main.add_command(action_showtests) +main.add_command(action_submit) +main.add_command(action_update) +main.add_command(action_updatedb) +main.add_command(action_view_comparison) +main.add_command(group_admin) +main.add_command(group_runtest) if __name__ == '__main__': Index: lnt/trunk/lnt/lnttool/updatedb.py =================================================================== --- lnt/trunk/lnt/lnttool/updatedb.py +++ lnt/trunk/lnt/lnttool/updatedb.py @@ -8,7 +8,6 @@ @click.option("--testsuite", required=True, help="testsuite to modify") @click.option("--tmp-dir", default="lnt_tmp", show_default=True, help="name of the temp file directory") -@click.option("--commit", is_flag=True, help="commit changes to the database") @click.option("--show-sql", is_flag=True, help="show SQL statements") @click.option("--delete-machine", "delete_machines", default=[], @@ -18,8 +17,8 @@ multiple=True, help="run ids to delete", type=int) @click.option("--delete-order", default=[], show_default=True, help="run ids to delete") -def action_updatedb(instance_path, database, testsuite, tmp_dir, commit, - show_sql, delete_machines, delete_runs, delete_order): +def action_updatedb(instance_path, database, testsuite, tmp_dir, show_sql, + delete_machines, delete_runs, delete_order): """modify a database""" from .common import init_logger from lnt.util import logger @@ -52,7 +51,4 @@ for machine in machines: ts.delete(machine) - if commit: - db.commit() - else: - db.rollback() + db.commit() Index: lnt/trunk/lnt/lnttool/viewcomparison.py =================================================================== --- lnt/trunk/lnt/lnttool/viewcomparison.py +++ lnt/trunk/lnt/lnttool/viewcomparison.py @@ -84,9 +84,9 @@ # Import the two reports. with contextlib.closing(config.get_database('default')) as db: r = import_and_report(config, 'default', db, report_a, '', - testsuite, commit=True, updateMachine=True) + testsuite, updateMachine=True) import_and_report(config, 'default', db, report_b, '', - testsuite, commit=True, updateMachine=True) + testsuite, updateMachine=True) # Dispatch another thread to start the webbrowser. comparison_url = '%s/v4/nts/2?compare_to=1' % (url,) Index: lnt/trunk/lnt/server/db/testsuitedb.py =================================================================== --- lnt/trunk/lnt/server/db/testsuitedb.py +++ lnt/trunk/lnt/server/db/testsuitedb.py @@ -1014,7 +1014,7 @@ def importDataFromDict(self, data, config, updateMachine, mergeRun): """ - importDataFromDict(data, commit, config, updateMachine, mergeRun) + importDataFromDict(data, config, updateMachine, mergeRun) -> Run (or throws ValueError exception) Import a new run from the provided test interchange data, and return Index: lnt/trunk/lnt/server/ui/templates/submit_run.html =================================================================== --- lnt/trunk/lnt/server/ui/templates/submit_run.html +++ lnt/trunk/lnt/server/ui/templates/submit_run.html @@ -14,12 +14,6 @@

Input Data (plist):
-

Commit*:
-
-

Update Machine: