Index: docs/importing_data.rst =================================================================== --- docs/importing_data.rst +++ docs/importing_data.rst @@ -18,7 +18,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: docs/quickstart.rst =================================================================== --- docs/quickstart.rst +++ 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: docs/tests.rst =================================================================== --- docs/tests.rst +++ docs/tests.rst @@ -131,7 +131,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: docs/tools.rst =================================================================== --- docs/tools.rst +++ 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. @@ -60,7 +56,7 @@ ``lnt createdb `` Creates a new LNT sqlite3 database at the specified path. - ``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/lnttool/import_data.py =================================================================== --- lnt/lnttool/import_data.py +++ lnt/lnttool/import_data.py @@ -1,6 +1,7 @@ import click import lnt.formats + @click.command("import") @click.argument("instance_path", type=click.UNPROCESSED) @click.argument("files", nargs=-1, type=click.Path(exists=True), required=True) @@ -9,7 +10,8 @@ @click.option("--format", "output_format", show_default=True, type=click.Choice(lnt.formats.format_names + ['']), default='', help="input format") -@click.option("--commit", is_flag=True, help="commit changes to the database") +@click.option("--commit", type=int, help="deprecated/ignored option", + expose_value=False) @click.option("--show-sql", is_flag=True, help="show SQL statements") @click.option("--show-sample-count", is_flag=True) @click.option("--show-raw-result", is_flag=True) @@ -19,9 +21,9 @@ @click.option("--quiet", "-q", is_flag=True, help="don't show test results") @click.option("--no-email", is_flag=True, help="don't send e-mail") @click.option("--no-report", is_flag=True, help="don't generate report") -def action_import(instance_path, files, database, output_format, commit, - show_sql, show_sample_count, show_raw_result, testsuite, - verbose, quiet, no_email, no_report): +def action_import(instance_path, files, database, output_format, show_sql, + show_sample_count, show_raw_result, testsuite, verbose, + quiet, no_email, no_report): """import test data into a database""" import contextlib import lnt.server.instance @@ -40,9 +42,8 @@ success = True 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) + config, database, db, file_name, output_format, testsuite, + show_sample_count, no_email, no_report) success &= result.get('success', False) if quiet: Index: lnt/lnttool/main.py =================================================================== --- lnt/lnttool/main.py +++ lnt/lnttool/main.py @@ -91,7 +91,7 @@ db = lnt.server.db.v4db.V4DB('sqlite:///:memory:', lnt.server.config.Config.dummy_instance()) result = lnt.util.ImportData.import_and_report( - None, None, db, input_file, 'json', testsuite, commit=True) + None, None, db, input_file, 'json', testsuite) lnt.util.ImportData.print_report_result(result, sys.stdout, sys.stderr, verbose=True) @@ -142,22 +142,16 @@ @click.command("submit") @click.argument("url") @click.argument("files", nargs=-1, type=click.Path(exists=True), required=True) -@click.option("--commit", is_flag=True, help="actually commit the data") +@click.option("--commit", type=int, help="deprecated/ignored option", + expose_value=False) @click.option("--verbose", "-v", is_flag=True, help="show verbose test results") -def action_submit(url, files, commit, verbose): +def action_submit(url, files, 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) for submitted_file in files: if verbose: lnt.util.ImportData.print_report_result( @@ -454,40 +448,28 @@ @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_checkformat) -cli.add_command(action_create) -cli.add_command(action_convert) -cli.add_command(action_import) -cli.add_command(action_importreport) -cli.add_command(action_profile) -cli.add_command(action_runserver) -cli.add_command(action_runtest) -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) - - -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_checkformat) +main.add_command(action_create) +main.add_command(action_convert) +main.add_command(action_import) +main.add_command(action_importreport) +main.add_command(action_profile) +main.add_command(action_runserver) +main.add_command(action_runtest) +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) if __name__ == '__main__': Index: lnt/lnttool/updatedb.py =================================================================== --- lnt/lnttool/updatedb.py +++ 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 lnt.util import logger import contextlib @@ -48,7 +47,4 @@ for machine in machines: ts.delete(machine) - if commit: - db.commit() - else: - db.rollback() + db.commit() Index: lnt/lnttool/viewcomparison.py =================================================================== --- lnt/lnttool/viewcomparison.py +++ 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) + testsuite) import_and_report(config, 'default', db, report_b, '', - testsuite, commit=True) + testsuite) # Dispatch another thread to start the webbrowser. comparison_url = '%s/v4/nts/2?compare_to=1' % (url,) Index: lnt/server/db/testsuitedb.py =================================================================== --- lnt/server/db/testsuitedb.py +++ lnt/server/db/testsuitedb.py @@ -879,7 +879,7 @@ return run, True - def _importSampleValues(self, tests_data, run, commit, config): + def _importSampleValues(self, tests_data, run, config): # Load a map of all the tests, which we will extend when we find tests # that need to be added. test_cache = dict((test.name, test) @@ -917,7 +917,7 @@ else: sample.set_field(field, value) - def importDataFromDict(self, data, commit, config=None): + def importDataFromDict(self, data, config=None): """ importDataFromDict(data) -> bool, Run @@ -939,7 +939,7 @@ if not inserted: return False, run - self._importSampleValues(data['tests'], run, commit, config) + self._importSampleValues(data['tests'], run, config) return True, run Index: lnt/server/ui/templates/submit_run.html =================================================================== --- lnt/server/ui/templates/submit_run.html +++ lnt/server/ui/templates/submit_run.html @@ -14,12 +14,6 @@

Input Data (plist):
-

Commit*:
-
-

Index: lnt/server/ui/views.py =================================================================== --- lnt/server/ui/views.py +++ lnt/server/ui/views.py @@ -100,7 +100,6 @@ assert request.method == 'POST' input_file = request.files.get('file') input_data = request.form.get('input_data') - commit = int(request.form.get('commit', 0)) != 0 if input_file and not input_file.content_length: input_file = None @@ -139,7 +138,7 @@ db = request.get_db() result = lnt.util.ImportData.import_from_string(current_app.old_config, - g.db_name, db, g.testsuite_name, data_value, commit=commit) + g.db_name, db, g.testsuite_name, data_value) # It is nice to have a full URL to the run, so fixup the request URL # here were we know more about the flask instance. Index: lnt/tests/builtintest.py =================================================================== --- lnt/tests/builtintest.py +++ lnt/tests/builtintest.py @@ -56,14 +56,12 @@ if output_stream is not sys.stdout: output_stream.close() - def submit(self, report_path, config, ts_name=None, commit=True): + def submit(self, report_path, config, ts_name=None): """Submit the results file to the server. If no server was specified, use a local mock server. report_path is the location of the json report file. config - holds options for submission url, and verbosity. When commit - is true, results will be saved in the server, otherwise you - will just get back a report but server state is not altered. + holds options for submission url, and verbosity. Returns the report from the server. """ @@ -76,7 +74,6 @@ self.log("submitting result to %r" % (config.submit_url,)) server_report = ServerUtil.submitFile(config.submit_url, report_path, - commit, config.verbose) else: # Simulate a submission to retrieve the results report. @@ -87,7 +84,7 @@ db = lnt.server.db.v4db.V4DB("sqlite:///:memory:", server_config.Config.dummy_instance()) server_report = ImportData.import_and_report( - None, None, db, report_path, 'json', ts_name, commit) + None, None, db, report_path, 'json', ts_name) assert server_report is not None, "Results were not submitted." Index: lnt/tests/compile.py =================================================================== --- lnt/tests/compile.py +++ lnt/tests/compile.py @@ -1051,9 +1051,8 @@ help=("autosubmit the test result to the given server " "(or local instance)"), type=click.UNPROCESSED, default=None) -@click.option("--commit", "commit", - help="whether the autosubmit result should be committed", - type=int, default=True) +@click.option("--commit", "commit", type=int, + help="deprecated/ignored option") @click.option("--output", "output", metavar="PATH", help="write raw report data to PATH (or stdout if '-')") @click.option("-v", "--verbose", "verbose", Index: lnt/tests/nt.py =================================================================== --- lnt/tests/nt.py +++ lnt/tests/nt.py @@ -1728,8 +1728,7 @@ for server in config.submit_url: self.log("submitting result to %r" % (server,)) try: - result = ServerUtil.submitFile(server, report_path, - commit, False) + result = ServerUtil.submitFile(server, report_path, False) except (urllib2.HTTPError, urllib2.URLError) as e: logger.warning("submitting to {} failed with {}" .format(server, e)) @@ -1743,7 +1742,7 @@ db = lnt.server.db.v4db.V4DB("sqlite:///:memory:", lnt.server.config.Config.dummy_instance()) result = lnt.util.ImportData.import_and_report( - None, None, db, report_path, 'json', 'nts', commit) + None, None, db, report_path, 'json', 'nts') if result is None: fatal("Results were not obtained from submission.") @@ -1984,8 +1983,7 @@ " (or local instance)"), type=click.UNPROCESSED, default=[], multiple=True) @click.option("--commit", "commit", - help="whether the autosubmit result should be committed", - type=int, default=True) + help="deprecated/ignored option", type=int, default=True) @click.option("--output", "output", metavar="PATH", help="write raw report data to PATH (or stdout if '-')", default=None) Index: lnt/tests/test_suite.py =================================================================== --- lnt/tests/test_suite.py +++ lnt/tests/test_suite.py @@ -346,7 +346,7 @@ with open(csv_report_path, 'w') as fd: fd.write(str_template) - return self.submit(report_path, self.opts, 'nts', commit=True) + return self.submit(report_path, self.opts, 'nts') def _configure_if_needed(self): mkdir_p(self._base_path) @@ -1055,9 +1055,8 @@ help="autosubmit the test result to the given server" " (or local instance)", type=click.UNPROCESSED, default=None) -@click.option("--commit", "commit", - help="whether the autosubmit result should be committed", - type=int, default=True) +@click.option("--commit", "commit", type=int, + help="deprecated/ignored option") @click.option("--succinct-compile-output", "succinct", help="run Make without VERBOSE=1", is_flag=True) @click.option("-v", "--verbose", "verbose", is_flag=True, default=False, Index: lnt/util/ImportData.py =================================================================== --- lnt/util/ImportData.py +++ lnt/util/ImportData.py @@ -12,17 +12,14 @@ import time def import_and_report(config, db_name, db, file, format, ts_name, - commit=False, show_sample_count=False, - disable_email=False, disable_report=False): + show_sample_count=False, disable_email=False, + disable_report=False): """ import_and_report(config, db_name, db, file, format, ts_name, - [commit], [show_sample_count], - [disable_email]) -> ... object ... + [show_sample_count], [disable_email]) -> ... object ... Import a test data file into an LNT server and generate a test report. On - success, run is the newly imported run. Note that success is uneffected by - the value of commit, this merely changes whether the run (on success) is - committed to the database. + success, run is the newly imported run. The result object is a dictionary containing information on the imported run and its comparison to the previous run. @@ -88,7 +85,7 @@ (data_schema, ts_name)) return result - success, run = ts.importDataFromDict(data, commit, config=db_config) + success, run = ts.importDataFromDict(data, config=db_config) except KeyboardInterrupt: raise except Exception as e: @@ -124,20 +121,16 @@ if show_sample_count: result['added_samples'] = ts.getNumSamples() - numSamples - result['committed'] = commit + result['committed'] = True result['run_id'] = run.id - if commit: - ts.commit() - if db_config: - # If we are not in a dummy instance, also run background jobs. - # We have to have a commit before we run, so subprocesses can - # see the submitted data. - async_ops.async_fieldchange_calc(db_name, ts, run, config) + ts.commit() + if db_config: + # If we are not in a dummy instance, also run background jobs. + # We have to have a commit before we run, so subprocesses can + # see the submitted data. + async_ops.async_fieldchange_calc(db_name, ts, run, config) - else: - ts.rollback() # Add a handy relative link to the submitted run. - result['result_url'] = "db_{}/v4/{}/{}".format(db_name, ts_name, run.id) result['report_time'] = time.time() - importStartTime result['total_time'] = time.time() - startTime @@ -156,8 +149,8 @@ # Perform the shadow import. shadow_result = import_and_report(config, shadow_name, shadow_db, file, format, ts_name, - commit, show_sample_count, - disable_email, disable_report) + show_sample_count, disable_email, + disable_report) # Append the shadow result to the result. result['shadow_result'] = shadow_result @@ -256,10 +249,6 @@ "already in the database.") % result['original_run'] print >>out - if not result['committed']: - print >>out, "NOTE: This run was not committed!" - print >>out - if result['report_to_address']: print >>out, "Report emailed to: %r" % result['report_to_address'] print >>out @@ -294,7 +283,7 @@ print >>out, kind, ":", count -def import_from_string(config, db_name, db, ts_name, data, commit=True): +def import_from_string(config, db_name, db, ts_name, data): # Stash a copy of the raw submission. # # To keep the temporary directory organized, we keep files in @@ -322,5 +311,5 @@ # should at least reject overly large inputs. result = lnt.util.ImportData.import_and_report(config, db_name, db, - path, '', ts_name, commit) + path, '', ts_name) return result Index: lnt/util/ServerUtil.py =================================================================== --- lnt/util/ServerUtil.py +++ lnt/util/ServerUtil.py @@ -28,10 +28,12 @@ if message: sys.stderr.write(message + '\n') -def submitFileToServer(url, file, commit): +def submitFileToServer(url, file): with open(file, 'rb') as f: - values = { 'input_data' : f.read(), - 'commit' : ("0","1")[not not commit] } + values = { + 'input_data' : f.read(), + 'commit' : "1", # used by older servers + } headers = {'Accept': 'application/json'} data = urllib.urlencode(values) try: @@ -58,7 +60,7 @@ return reply -def submitFileToInstance(path, file, commit): +def submitFileToInstance(path, file): # Otherwise, assume it is a local url and submit to the default database # in the instance. instance = lnt.server.instance.Instance.frompath(path) @@ -68,25 +70,24 @@ if db is None: raise ValueError("no default database in instance: %r" % (path,)) return lnt.util.ImportData.import_and_report( - config, db_name, db, file, format='', ts_name='nts', - commit=commit) + config, db_name, db, file, format='', ts_name='nts') -def submitFile(url, file, commit, verbose): +def submitFile(url, file, verbose): # If this is a real url, submit it using urllib. if '://' in url: - result = submitFileToServer(url, file, commit) + result = submitFileToServer(url, file) if result is None: return else: - result = submitFileToInstance(url, file, commit) + result = submitFileToInstance(url, file) return result -def submitFiles(url, files, commit, verbose): +def submitFiles(url, files, verbose): results = [] for file in files: - result = submitFile(url, file, commit, verbose) + result = submitFile(url, file, verbose) if result: results.append(result) return results Index: tests/lnttool/PostgresDB.shtest =================================================================== --- tests/lnttool/PostgresDB.shtest +++ tests/lnttool/PostgresDB.shtest @@ -12,16 +12,16 @@ lnt create "${TESTDIR}/instance" --db-dir ${PGURL} --default-db lnt_regr_test_PostgresDB # Import a test set. -lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --commit --show-sample-count +lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --show-sample-count # Import a test set. -lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --commit --show-sample-count +lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --show-sample-count # Check that we remove both the sample and the run, and that we don't commit by # default. # lnt updatedb "${TESTDIR}/instance" --testsuite nts --delete-run 1 \ - --commit --show-sql > "${TESTDIR}/runrm.out" + --show-sql > "${TESTDIR}/runrm.out" # RUN: FileCheck --check-prefix CHECK-RUNRM %s < "%t.install/runrm.out" # CHECK-RUNRM: DELETE FROM "NT_Sample" WHERE "NT_Sample"."ID" = %(ID)s @@ -31,12 +31,12 @@ # CHECK-RUNRM: COMMIT # Import a test set. -lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --commit --show-sample-count +lnt import "${TESTDIR}/instance" "${SHARED_INPUTS}/sample-a-small.plist" --show-sample-count # Check that we remove runs when we remove a machine. # lnt updatedb "${TESTDIR}/instance" --testsuite nts \ - --delete-machine "LNT SAMPLE MACHINE" --commit \ + --delete-machine "LNT SAMPLE MACHINE" \ --show-sql > "${TESTDIR}/machinerm.out" # RUN: FileCheck --check-prefix CHECK-MACHINERM %s < "%t.install/machinerm.out" Index: tests/lnttool/UpdateDB.py =================================================================== --- tests/lnttool/UpdateDB.py +++ tests/lnttool/UpdateDB.py @@ -3,13 +3,13 @@ # Import a test set. # RUN: lnt import %t.install %{shared_inputs}/sample-a-small.plist \ -# RUN: --commit --show-sample-count +# RUN: --show-sample-count # Check that we remove both the sample and the run, and that we don't commit by # default. # # RUN: lnt updatedb %t.install --testsuite nts \ -# RUN: --commit --delete-run 1 --show-sql > %t.out +# RUN: --delete-run 1 --show-sql > %t.out # RUN: FileCheck --check-prefix CHECK-RUNRM %s < %t.out # CHECK-RUNRM: DELETE FROM "NT_Sample" WHERE "NT_Sample"."ID" = ? @@ -23,9 +23,9 @@ # RUN: rm -rf %t.install # RUN: lnt create %t.install # RUN: lnt import %t.install %{shared_inputs}/sample-a-small.plist \ -# RUN: --commit --show-sample-count +# RUN: --show-sample-count # RUN: lnt updatedb %t.install --testsuite nts \ -# RUN: --delete-machine "LNT SAMPLE MACHINE" --commit --show-sql > %t.out +# RUN: --delete-machine "LNT SAMPLE MACHINE" --show-sql > %t.out # RUN: FileCheck --check-prefix CHECK-MACHINERM %s < %t.out # CHECK-MACHINERM: DELETE FROM "NT_Sample" WHERE "NT_Sample"."ID" = ? Index: tests/lnttool/submit.shtest =================================================================== --- tests/lnttool/submit.shtest +++ tests/lnttool/submit.shtest @@ -9,7 +9,7 @@ SHARED_INPUTS="$3" SRC_ROOT="$4" -lnt submit "http://localhost:9091/db_default/submitRun" --commit 1 "${SHARED_INPUTS}/sample-report.json" -v > "${OUTPUT_DIR}/submit_verbose.txt" +lnt submit "http://localhost:9091/db_default/submitRun" "${SHARED_INPUTS}/sample-report.json" -v > "${OUTPUT_DIR}/submit_verbose.txt" # RUN: FileCheck %s --check-prefix=CHECK-VERBOSE < %T/submit_verbose.txt # # CHECK-VERBOSE: Import succeeded. @@ -27,7 +27,7 @@ # CHECK-VERBOSE: Results available at: http://localhost:9091/db_default/v4/nts/3 -lnt submit "http://localhost:9091/db_default/submitRun" --commit "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit0.txt" +lnt submit "http://localhost:9091/db_default/submitRun" "${SHARED_INPUTS}/sample-report.json" > "${OUTPUT_DIR}/submit0.txt" # RUN: FileCheck %s --check-prefix=CHECK-DEFAULT < %T/submit0.txt # # Make sure the old --commit=1 style argument is still accepted. @@ -40,7 +40,7 @@ # CHECK-DEFAULT: http://localhost:9091/db_default/v4/nts/3 -lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile.txt" +lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile.txt" # RUN: FileCheck %s --check-prefix=CHECK-COMPILE0 < %T/submit_compile.txt # # CHECK-COMPILE0: --- Tested: 10 tests -- @@ -56,7 +56,7 @@ # CHECK-COMPILE0: PASS : 10 # CHECK-COMPILE0: Results available at: http://localhost:9091/db_default/v4/compile/5 -lnt submit "http://localhost:9091/db_default/submitRun" --commit "${SRC_ROOT}/docs/report-example.json" -v > "${OUTPUT_DIR}/submit_newformat.txt" +lnt submit "http://localhost:9091/db_default/submitRun" "${SRC_ROOT}/docs/report-example.json" -v > "${OUTPUT_DIR}/submit_newformat.txt" # RUN: FileCheck %s --check-prefix=CHECK-NEWFORMAT < %T/submit_newformat.txt # # CHECK-NEWFORMAT: Import succeeded. @@ -76,7 +76,7 @@ # For the old submitters/formats we have some detection logic to determine the # test-suite based on the Info.Run.tag field instead of the URL. The result # should be the same as using the "correct" URL. -lnt submit "http://localhost:9091/db_default/submitRun" --commit "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile1.txt" +lnt submit "http://localhost:9091/db_default/submitRun" "${INPUTS}/compile_submission.json" -v > "${OUTPUT_DIR}/submit_compile1.txt" # RUN: FileCheck %s --check-prefix=CHECK-COMPILE1 < %T/submit_compile1.txt # # CHECK-COMPILE1: Import succeeded. @@ -88,16 +88,16 @@ # Check some error handling/reporting rm -f "${OUTPUT_DIR}/submit_errors.txt" -lnt submit "http://localhost:9091/db_default/v4/badsuite/submitRun" --commit "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 +lnt submit "http://localhost:9091/db_default/v4/badsuite/submitRun" "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 # RUN: FileCheck %s --check-prefix=CHECK-ERRORS < %T/submit_errors.txt # CHECK-ERRORS: lnt server error: Unknown test suite 'badsuite'! -lnt submit "http://localhost:9091/db_baddb/v4/compile/submitRun" --commit "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 +lnt submit "http://localhost:9091/db_baddb/v4/compile/submitRun" "${INPUTS}/compile_submission.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 # CHECK-ERRORS: lnt server error: The page you are looking for does not exist. -lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/invalid_submission0.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 +lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" "${INPUTS}/invalid_submission0.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 # CHECK-ERRORS: lnt server error: could not parse input format # ... # CHECK-ERRORS: SystemExit: unable to guess input format for -lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" --commit "${INPUTS}/invalid_submission1.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 +lnt submit "http://localhost:9091/db_default/v4/compile/submitRun" "${INPUTS}/invalid_submission1.json" >> "${OUTPUT_DIR}/submit_errors.txt" 2>&1 # CHECK-ERRORS: lnt server error: import failure: machine # ... # CHECK-ERRORS: KeyError: 'machine' Index: tests/server/db/ImportProfile.py =================================================================== --- tests/server/db/ImportProfile.py +++ tests/server/db/ImportProfile.py @@ -6,7 +6,7 @@ # Import the test set # RUN: lnt import %t.install %S/Inputs/profile-report.json \ -# RUN: --commit --show-sample-count > %t2.log +# RUN: --show-sample-count > %t2.log # RUN: ls %t.install/data/profiles # RUN: python %s %t.install Index: tests/server/db/ImportV4TestSuiteInstance.py =================================================================== --- tests/server/db/ImportV4TestSuiteInstance.py +++ tests/server/db/ImportV4TestSuiteInstance.py @@ -6,7 +6,7 @@ # Import the first test set. # RUN: lnt import %t.install %{shared_inputs}/sample-a-small.plist \ -# RUN: --commit --show-sample-count > %t1.log +# RUN: --show-sample-count > %t1.log # RUN: FileCheck -check-prefix=IMPORT-A-1 %s < %t1.log # # IMPORT-A-1: Added Machines: 1 @@ -16,7 +16,7 @@ # Import the second test set. # RUN: lnt import %t.install %{shared_inputs}/sample-b-small.plist \ -# RUN: --commit --show-sample-count --show-sql > %t2.log +# RUN: --show-sample-count --show-sql > %t2.log # RUN: FileCheck -check-prefix=IMPORT-B %s < %t2.log # # IMPORT-B: Added Runs : 1 @@ -24,7 +24,7 @@ # Check that reimporting the first test set properly reports as a duplicate. # RUN: lnt import %t.install %{shared_inputs}/sample-a-small.plist \ -# RUN: --commit --show-sample-count > %t3.log +# RUN: --show-sample-count > %t3.log # RUN: FileCheck -check-prefix=IMPORT-A-2 %s < %t3.log # # IMPORT-A-2: This submission is a duplicate of run 1 Index: tests/server/db/search.py =================================================================== --- tests/server/db/search.py +++ tests/server/db/search.py @@ -44,8 +44,8 @@ result = lnt.util.ImportData.import_and_report( None, 'default', self.db, f.name, - '', 'nts', True, False, - True, True) + '', 'nts', show_sample_count=False, + disable_email=True, disable_report=True) success &= result.get('success', False) Index: tests/server/db/yamlschema.shtest =================================================================== --- tests/server/db/yamlschema.shtest +++ tests/server/db/yamlschema.shtest @@ -1,7 +1,7 @@ # RUN: rm -rf "%t.install" # RUN: lnt create "%t.install" # RUN: ln -sf %{src_root}/docs/schema-example.yaml "%t.install/schemas/size.yaml" -# RUN: lnt import "%t.install" -s size %S/Inputs/customschema-report.json --commit | FileCheck %s +# RUN: lnt import "%t.install" -s size %S/Inputs/customschema-report.json | FileCheck %s # CHECK: Import succeeded. # CHECK: Imported Data @@ -19,30 +19,30 @@ # =============== # # Inserting with an extra field shouldn't work just yet -# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report2.json" --commit 2>&1 | FileCheck %s --check-prefix=NOTUPGRADED +# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report2.json" 2>&1 | FileCheck %s --check-prefix=NOTUPGRADED # NOTUPGRADED: Metric u'newfield' unknown in suite # Upgrading to a schema with metrics/fields removed should fail # RUN: rm -f "%t.install/schemas/size.yaml" # RUN: ln -sf "%S/Inputs/schema-example-nomigration0.yaml" "%t.install/schemas/size.yaml" -# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" --commit 2>&1 | FileCheck %s --check-prefix=NOMIGRATION0 +# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" 2>&1 | FileCheck %s --check-prefix=NOMIGRATION0 # NOMIGRATION0: Cannot automatically migrate database: Metrics removed: data_size # # RUN: rm -f "%t.install/schemas/size.yaml" # RUN: ln -sf "%S/Inputs/schema-example-nomigration1.yaml" "%t.install/schemas/size.yaml" -# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" --commit 2>&1 | FileCheck %s --check-prefix=NOMIGRATION1 +# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" 2>&1 | FileCheck %s --check-prefix=NOMIGRATION1 # NOMIGRATION1: Cannot automatically migrate database: Machine fields removed: os # # RUN: rm -f "%t.install/schemas/size.yaml" # RUN: ln -sf "%S/Inputs/schema-example-nomigration2.yaml" "%t.install/schemas/size.yaml" -# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" --commit 2>&1 | FileCheck %s --check-prefix=NOMIGRATION2 +# RUN: not lnt import "%t.install" -s size "%S/Inputs/customschema-report.json" 2>&1 | FileCheck %s --check-prefix=NOMIGRATION2 # NOMIGRATION2: Cannot automatically migrate database: Type mismatch in metric 'data_size' # This upgrade should finally work # RUN: rm -f "%t.install/schemas/size.yaml" # RUN: ln -sf "%S/Inputs/schema-example-migratable.yaml" "%t.install/schemas/size.yaml" -# RUN: lnt import "%t.install" "%S/Inputs/customschema-report2.json" -s size --commit --show-sql 2>&1 | FileCheck %s --check-prefix=MIGRATION +# RUN: lnt import "%t.install" "%S/Inputs/customschema-report2.json" -s size --show-sql 2>&1 | FileCheck %s --check-prefix=MIGRATION # # MIGRATION: ALTER TABLE "size_Sample" ADD COLUMN newfield FLOAT # MIGRATION: ALTER TABLE "size_Run" ADD COLUMN new_run_field VARCHAR(256) Index: tests/utils/blast.py =================================================================== --- tests/utils/blast.py +++ tests/utils/blast.py @@ -20,7 +20,7 @@ def external_submission(url, fname): """Use a LNT subprocess to submit our results.""" assert os.path.exists(fname) - cmd = "lnt submit --verbose --commit {url} {file}".format( + cmd = "lnt submit --verbose {url} {file}".format( url=url, file=fname) print "Calling " + cmd subprocess.check_call(cmd, shell=True)