diff --git a/testmon/__init__.py b/testmon/__init__.py index 140b5d9..738ddcd 100644 --- a/testmon/__init__.py +++ b/testmon/__init__.py @@ -1,2 +1,2 @@ """PYTEST_DONT_REWRITE""" -VERSION = "2.0.12" +VERSION = "2.0.13" diff --git a/testmon/db.py b/testmon/db.py index 90e04fd..39e7048 100644 --- a/testmon/db.py +++ b/testmon/db.py @@ -8,7 +8,7 @@ from testmon.process_code import blob_to_checksums, checksums_to_blob -DATA_VERSION = 12 +DATA_VERSION = 13 ChangedFileData = namedtuple( "ChangedFileData", "filename name method_checksums id failed" @@ -54,6 +54,8 @@ def __init__(self, datafile): if new_db or old_format: self.init_tables() + self.con.executescript(self._local_temp_tables_statement()) + def version_compatibility(self): return DATA_VERSION @@ -349,13 +351,19 @@ def _create_test_execution_statement(self): forced BIT, FOREIGN KEY({self._test_execution_fk_column()}) REFERENCES {self._test_execution_fk_table()}(id)); CREATE INDEX test_execution_fk_name ON test_execution ({self._test_execution_fk_column()}, test_name); + """ + + def _create_temp_tables_statement(self): + return "" - CREATE TABLE changed_files_fshas (exec_id INTEGER, filename TEXT, fsha TEXT); + def _local_temp_tables_statement(self): + return """ + CREATE TEMPORARY TABLE changed_files_fshas (exec_id INTEGER, filename TEXT, fsha TEXT); CREATE INDEX changed_files_fshas_mcall ON changed_files_fshas (exec_id, filename, fsha); - CREATE TABLE changed_files_mhashes (exec_id INTEGER, filename TEXT, mhashes BLOB); + CREATE TEMPORARY TABLE changed_files_mhashes (exec_id INTEGER, filename TEXT, mhashes BLOB); CREATE INDEX changed_files_mhashes_eid ON changed_files_mhashes (exec_id); - """ + """ def _create_file_fp_statement(self): return """ @@ -397,6 +405,7 @@ def init_tables(self): self._create_metadata_statement() + self._create_environment_statement() + self._create_test_execution_statement() + + self._create_temp_tables_statement() + self._create_file_fp_statement() + self._create_test_execution_ffp_statement() )