summaryrefslogtreecommitdiff
path: root/tko/migrations
AgeCommit message (Collapse)AuthorFilesLines
2010-03-23Rebase the AUTOTEST_WEB database to schema version 51. Also default thejamesren1-175/+2
migration manager to the AUTOTEST_WEB database, since the TKO database has been removed. Signed-off-by: James Ren <jamesren@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@4317 592f7852-d20e-0410-864c-8624ca9c26a4
2010-01-12Merge the two databases and the two Django projects. Note that the TKO ↵showard1-0/+0
migrations are still present, as is the migration code for TKO in database/migrate.py. These pieces of code are preserved because they are required by this change to perform the merge. A separate change will be submitted in the future to remove those references. WARNING: This change will move all tables in TKO into the AUTOTEST_WEB database. Custom TKO tables that Autotest does not know about will NOT be moved, and will be lost after this change. Any scripts that run directly against the TKO database will cease functioning until they are modified to run against AUTOTEST_WEB. Additionally, if you were importing any .py files from autotest_lib.new_tko.tko.*, they have been moved to autotest_lib.frontend.tko.* Notes: You will need to manually create two files after applying this patch touch <autotest_dir>/frontend/tko/__init__.py touch <autotest_dir>/tko/migrations/__init__.py Optionally, you can also remove the entire <autotest_dir>/new_tko/ directory, as it is no longer needed. Signed-off-by: James Ren <jamesren@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@4106 592f7852-d20e-0410-864c-8624ca9c26a4
2010-01-11Massive permission fixlmr1-0/+0
Fix permissions for all the development tree Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com> git-svn-id: svn://test.kernel.org/autotest/trunk@4094 592f7852-d20e-0410-864c-8624ca9c26a4
2009-12-23Rename the tables in the databases, by prefixing the app name. This isshoward2-0/+386
in preparation for merging the two databases and the two Django projects into one. Note that this renames *all* standard Autotest DB tables in both the autotest_web and tko databases. If you have scripts written directly against these databases, *they will break*. If your scripts access the RPC interfaces, they should continue to work. Another patch will be along within the next few weeks to actually move the TKO tables into the autotest_web database. From: James Ren <jamesren@google.com> Signed-off-by: Steve Howard <showard@google.com> Rename the tables in the databases, by prefixing the app name. This is in preparation for merging the two databases and the two Django projects into one. Note that this renames *all* standard Autotest DB tables in both the autotest_web and tko databases. If you have scripts written directly against these databases, *they will break*. If your scripts access the RPC interfaces, they should continue to work. From: James Ren <jamesren@google.com> Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@4040 592f7852-d20e-0410-864c-8624ca9c26a4
2009-09-08Added afe_job_id column to the jobs table in TKO. Changed link in AFEshoward1-0/+77
View Job tab to use afe_job_id instead of job_tag. Signed-off-by: James Ren <jamesren@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3665 592f7852-d20e-0410-864c-8624ca9c26a4
2009-08-31TKO migration to ensure the "invalidated" label exists.showard1-0/+15
Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3629 592f7852-d20e-0410-864c-8624ca9c26a4
2009-05-12Add a foreign key from tests->jobs. Requires modifying tests.job_idxjadmanski1-0/+19
to be of the same data type as jobs.job_idx. Risk: Low Visibility: Adds another foreign key constraint. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3111 592f7852-d20e-0410-864c-8624ca9c26a4
2009-05-12Add the ability for users to add test attributes. Non-user-created ↵showard1-0/+9
attributes (added by the parser) are still immutable. * add boolean column user_created to TestAttribute to keep track of which are user created, so we can preserve immutability * add id primary key field to test attributes. Django requires this and we've been squeezing by without it, but we can't anymore. * declare some PK fields AutoFields in TKO models, as they should be. this didn't matter before but does now that we have a TKO unit test, since these models determine how the test DB gets created. * add set_test_attribute RPC to set/delete attributes * modify get_detailed_test_views() to use the new populate_relationships() method to gather attributes and labels much more efficiently * add rpc_interface_unittest, a unit test for the TKO rpc interface. TKO was previously completely untested, so this is the first unit test of any kind for it. since the doctests on AFE turned out to be quite unpopular, I'm using the unittest framework this time. this required some changes to AFE testing code. * various fixes to model_logic to account for assumptions we were previously making that aren't true in TKO (mostly about PK fields being named "id"). Note that the migration may be slow, as it's adding two columns to test_attributes, a potentially large table. Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3109 592f7852-d20e-0410-864c-8624ca9c26a4
2009-05-05Updated the 'view=' URL parameter to match new view ID in frontend.showard1-0/+10
Risk: medium (database changes) Visibility: medium (UI bug fix) Signed-off-by: James Ren <jamesren@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3091 592f7852-d20e-0410-864c-8624ca9c26a4
2009-04-21Fix a bug in the parser when dealing with test labels. The finaljadmanski1-0/+24
reparse drops the existing test entries and replaces them with new ones, so that leaves behind a bunch of orphaned labels in the database and basically kills all the lables you've added. So instead we add some code to move the existing labels over the new entries that replace them (making a best effort to match up "new" and "old" entries). Add foreign keys to the test_labels_tests table. This also requires compacting test_labels_tests into an unsigned int(10), since that's what the tests.test_idx field is. Risk: Low Visibility: Fix up the parser's handling of test labels, and add foreign keys that should've been there from the start (but were dropped because of MyISAM vs InnoDB issues). Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3022 592f7852-d20e-0410-864c-8624ca9c26a4
2009-04-20Index the test_id field on test_labels_tests. When people query with an ↵showard1-0/+7
exclusion of multiple labels, MySQL will want to use this index to join from tests to test_labels_tests on the test_idx. Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3016 592f7852-d20e-0410-864c-8624ca9c26a4
2009-04-17Change tests to have a default for the invalid fieldmbligh1-0/+6
Signed-off-by: Scott Zawalski <scottz@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@3000 592f7852-d20e-0410-864c-8624ca9c26a4
2009-04-15Several of out attributes (like bootnum and boot_times) that are standard ↵mbligh1-0/+7
test_attributes are signifigantly longer than 100 char. So extended value column to 1K. Signed-off-by: Travis Miller <raphtee@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2987 592f7852-d20e-0410-864c-8624ca9c26a4
2009-03-09Added frontend/migrations/027_fix_innodb.py andmbligh1-0/+14
tko/migrations/021_fix_innodb.py to perform ALTER TABLE ... ENGINE=InnoDB on tables missing it. Signed-off-by: Mihai Rusu <dizzy@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2858 592f7852-d20e-0410-864c-8624ca9c26a4
2009-02-27Apparently depending on what keys & db version and engines you have,jadmanski1-1/+1
this may fail because varchar(1000) is too large. Change it to 700 instead; this should work on all systems. Normally I would release a new migration to fix an old one, but this error will prevent you from running a 021 migration so that's not an option. Obviously, the underscores the "this appraoch doesn't scale". Risk: Low Visibility: Fixes a broken db migration Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2838 592f7852-d20e-0410-864c-8624ca9c26a4
2009-02-25Make the hostname field bigger in TKO. The is unfortunately somethingjadmanski1-0/+5
of a hack due to the fact that with multi-machine tests where the results can't be associated with a single machine we work around the issue by cramming all of the hostname(s) into the field. We need a better strategy going forward (and obviously this won't scale up eventually, either) but until we do that this is a quick workaround to allow us to store more names in the field. Risk: Low Visibility: Larger hostname entries will not be truncated Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2822 592f7852-d20e-0410-864c-8624ca9c26a4
2008-10-28Widened the test field to 60 chars from 30 chars.mbligh1-0/+5
Signed-off-by: Travis Miller <raphtee@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2347 592f7852-d20e-0410-864c-8624ca9c26a4
2008-10-21Add indices to TKO. These range from absolutely performance criticalmbligh1-0/+34
indices (like tests.job_idx) to ones that might help a little bit (kernels.printable). This change will help mysql performance dramatically in large installations. Risk: Low Visibility: Things will be faster. Signed-off-by: Jeremy Orlow <jorlow@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2313 592f7852-d20e-0410-864c-8624ca9c26a4
2008-10-03Add a generic database wrapper, supporting different database backends, to ↵showard1-2/+2
be used by migrate, scheduler, parser (eventually), and maybe others. This will consolidate the multiple database wrappers we have throughout the code and allow us to swap in SQLite for MySQL for unit testing purposes. -add database/ directory for database libraries. migrate.py will move here soon. -add database_connection.py under server_common, a basic database wrapper supporting both MySQL and SQLite. PostgreSQL should be an easy future addition (any library supporting Python DB-API should be trivial to add). DatabaseConnection also supports graceful handling of dropped connections. -add unittest for DatabaseConnection -change migrate.py to use common DatabaseConnection. Scheduler will be changed to use it in a coming CL and in the future hopefully the TKO parser will be able to use it as well. -change migrate_unittest.py to use SQLite. Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2234 592f7852-d20e-0410-864c-8624ca9c26a4
2008-09-22-add --force option to migrations to disable user confirmation because this ↵showard1-6/+7
can make migrations unscriptable -add default migration dirs to migrate.py because having to cd to the right place was getting really annoying! -made monitor_db_unittest.py use migrations to initialize the test DB schema instead of copying the schema from the real DB, since that was creating problems for testing. this slows down the test considerably, but it's better than no testing at all (and we can improve it in the future). -made global_config allow overriding options, which is useful for testing Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@2180 592f7852-d20e-0410-864c-8624ca9c26a4
2008-09-19Attached is a large patch for a powerful and flexible new graphing system ↵showard3-0/+179
for new TKO. This system subsumes all the previous kernel graphing scripts under the tko/ directory and is capable of much more. These wiki pages document usage of the new system and give an idea of what it's capable of: http://autotest.kernel.org/wiki/MetricsPlot http://autotest.kernel.org/wiki/MachineQualHistograms Feel free to try it out and please let us know if you run into any trouble. This system is the work of our summer intern James Ren. Thank you for all your fantastic work, James! From: James Ren <jamesren@stanford.edu> git-svn-id: svn://test.kernel.org/autotest/trunk@2171 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-28-add test_view_2 with more sensible field names, for use by new TKO. this ↵showard1-0/+38
is intended to replace test_view, but I don't want to modify test_view until old TKO is phased out. -ensure "loading" popup doesn't get closed too early, especially on initial load -extend logic for RPC serialization for new TKO git-svn-id: svn://test.kernel.org/autotest/trunk@1916 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-17Fixed the perf_view database view in TKO. Changed an INNER JOIN to join on thembligh1-0/+79
correct column. Risk: low Visibility: low Signed-off-by: James Ren <jamesren@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1866 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-15Modify the parser and tko db code to flag test models as being forjadmanski1-0/+6
insertion or update, add a new "RUNNING" status to tko, and then add code to the v1 parser to generate a "RUNNING" record when the test starts and then a final update record when the test ends. Risk: High Visibility: When a test is in progress mostly-empty RUNNING results should show up in tko, to be replaced by the final record when the test finishes. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1836 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-11Change the name of the magic JOB entry in the status log parsing tojadmanski1-0/+11
CLIENT_JOB, since that's what it actually corresponds to. Risk: Low Visibility: Changes what will show up in the tko results (again). Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1826 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-11Migration file for test labels. Add a test_labels table and a ↵showard1-0/+27
test_labels_tests table that forms a many-to-many relationship between tests and test labels. The interface to manage these test labels is being developed as part of the new TKO interface. git-svn-id: svn://test.kernel.org/autotest/trunk@1811 592f7852-d20e-0410-864c-8624ca9c26a4
2008-07-11some changes to support saved queries for new TKOshoward1-0/+20
-migration to add saved_queries table. this is different from the existing query_history table. this feature is incompatible with the old one and I didn't want to interfere with the old one. -various modifications to history handling across the board to allow better support for saved queries (the url will show up as just "saved_query=123", without all the extra crap) -refactoring of apache_auth.py to allow new TKO to use it without using all the Django auth crap git-svn-id: svn://test.kernel.org/autotest/trunk@1810 592f7852-d20e-0410-864c-8624ca9c26a4
2008-06-06Convert all python code to use four-space indents instead of eight-space tabs.jadmanski8-385/+384
Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1658 592f7852-d20e-0410-864c-8624ca9c26a4
2008-06-02Change the VARCHAR for url from 65k to 1kmbligh1-1/+1
Rationale: URLs shouldn't come anywhere near the size of 65k characters and it would be better to start off small and wait for people to hit the 1k limit than to start out with a limit no one will hit and largely increase our database Signed-off-by: Scott Zawalski <scottz@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1577 592f7852-d20e-0410-864c-8624ca9c26a4
2008-05-21Reason column width in table tko.tests needs to be increased to a larger valuembligh1-0/+5
so that longer reason values are not truncated when they are put in the database. Signed-off-by: Vladimir Samarskiy <vsamarsk@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1543 592f7852-d20e-0410-864c-8624ca9c26a4
2008-05-21Risk: Mediumjadmanski1-0/+22
Visibility: Changes the test keyval interface, deprecating the existing test.write_keyval method in favour of a pair of write_*_keyval methods for writing test & iteration keyvals. The deprecated method will still work as it did before, but will generate a warning. Adds a new iteration_attributes table to the database for storing generic string attributes on a per-iteration basis, in the same way that test_attributes allows generic string attributes on a per-test basis. This also adds new methods to the test class for writing these keyvals so that tests can write out attributes by calling self.write_test_keyval (or self.write_iteration_keyval). The iteration method accepts parameters for both generic attributes and performance data. In order to store both performance and non-performance data in the iteration keyvals, the format of the line has been extended to look like "key{blah}=value", with no {blah} being interpreted as equvalent to "{perf}", for backwards compatiblity. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1535 592f7852-d20e-0410-864c-8624ca9c26a4
2008-05-21 Overview:mbligh1-0/+18
Implement user's request: save query on demand a) Add to TKO greed view a form containing button [SaveQuery] and edit control for optional comments b) On saveQuery request TKO make sure that user's cookies contain a unique user's id c) ... and then write into table query_history in TKO: time stamp, comment, uid, url of the query d) Make sure user can read saved queries back ( can read only his/her own queries ) compose_query.cgi - added a form that supports user's request to save cu rrent query save_query.cgi - saves the query query_history.cgi - shows saved queries by this user unique_cookie.py - common cookie related function: set/get user's unique id 006_add_table_query_history.py - database migration. New table introduce d for query history. From: vsamarsk@google.com git-svn-id: svn://test.kernel.org/autotest/trunk@1533 592f7852-d20e-0410-864c-8624ca9c26a4
2008-05-01Add a new status field called TEST_NA (in addition to PASS and FAIL). mbligh1-0/+6
From: Travis Miller git-svn-id: svn://test.kernel.org/autotest/trunk@1476 592f7852-d20e-0410-864c-8624ca9c26a4
2008-04-18Add tests.started_time to the results database, and add support in thembligh1-0/+149
parser for extracting those times. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1453 592f7852-d20e-0410-864c-8624ca9c26a4
2008-03-12Add downgrade support to migrate. This is really necessary for doing real ↵mbligh3-6/+154
migration development. Modified all existing migrations to support it. Signed-off-by: Steve Howard <showard@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1336 592f7852-d20e-0410-864c-8624ca9c26a4
2008-02-19Strip the optional fields (e.g. timestamps) out of the reason fieldsmbligh1-0/+72
when parsing test results. Also, add a test_finished_time field for storing the timestamp in the database. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1248 592f7852-d20e-0410-864c-8624ca9c26a4
2008-02-19Add job queued, started and finished timestamps to the tko db andmbligh1-0/+74
modify the parsing code to find these timestamps in the job keyval file and insert them into the db. Signed-off-by: John Admanski <jadmanski@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1246 592f7852-d20e-0410-864c-8624ca9c26a4
2008-02-15add missing tko/migrationsmbligh1-0/+190
Signed-off-by: Martin J. Bligh <mbligh@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1243 592f7852-d20e-0410-864c-8624ca9c26a4