summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2016-06-13toaster: tests browser Fix selenium tests after bootstrap3 breakagemichaelw/toaster/sync-toaster-nextMichael Wood
Fix a number of selectors which have changed after the port to bootstrap3. Also fix the modal wait_until_visible and returning of the text for the radio buttons in the modals for edit custom image and new custom image on the build dashboard. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: tests Rename test settings to python compliant name and fix importMichael Wood
Use underscore instead of dash in the file name for the test settings. Also fix the import of the settings module. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: selenium tests Fix all_projects page and sample testsMichael Wood
Fix the selectors after changes made for bootstrap3 and table links being removed. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: selenium tests Update unique custom image string and fix importMichael Wood
- Update the string for recognising a duplicate image recipe - Fix an incorrect relative import Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: js tests Twitter typeahead library object is now ttTypeaheadMichael Wood
Get the ttTypeahead object on the input to see if it's been initialised correctly. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: fix wrong usage of print_exc and format_excEd Bartosh
First parameter of traceback.print_exc and traceback.format_exc APIs is a 'limit' - a number of stracktraces to print. Passing exception object to print_exc or format_exc is incorrect, but it works in Python 2 and causes printing only one line of traceback. In Python 3 comparison of integer and exception object throws exception: TypeError: unorderable types: int() < <Exception type>() As these APIs are usually used in except block of handling another exception this can cause hard to find and debug bugs. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: changed python version in shebangEd Bartosh
Changed python to python3 in shebang to ensure that manage.py is always run by python3. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: toastergui tests Use new BeautifulSoup syntaxMichael Wood
Fix deprecation warning specify the parser used for creating the BeautifulSoup object. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: open image files in binary mode when sending in responseElliot Smith
The view code for downloading image files used the "r" flag to read the file, then used the open file object to form the HTTP response. While this worked in Python 2, Python 3 appears to be more strict about this sort of thing, and Django throws a UnicodeDecodeError when a file opened this way is used in a response. Open the file with the "b" flag (binary mode) so that Django can correctly convert the binary file handle to an HTTP response. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster-tests: fix tests for latest Selenium versionElliot Smith
Previously, we didn't specify a specific version of Selenium. When upgrading to Python 3 and installing Selenium to work with it, the JS unit test broke, as the report format produced by Selenium had changed. Modify the test so that it works with the latest Selenium report format. Add a note to the README that the given Selenium version should be used to prevent unexpected test failures. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: fix broken reference to urllibElliot Smith
The code previously imported urllib to make use of querystring quoting, but was modified to support Python 3. During this process, the reference to urllib was not fixed, which resulted in table filters breaking. Remove the reference to urllib (which is no longer imported) and instead reference the imported unquote_plus() function. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: fix test_toaster_tablesEd Bartosh
Removed unneeded code as it causes the following error in Python 3: TypeError: expected bytes, bytearray or buffer compatible object Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: fix incorrect file modeEd Bartosh
Python 3 complains about 'wa' mode this way: ValueError: must have exactly one of create/read/write/append mode Fixed by using 'a' mode. [YOCTO #9584] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: decode response contentEd Bartosh
Decoded response content to str to pass it to json.load as it breaks in Python 3 with this error: TypeError: expected bytes, bytearray or buffer compatible object [YOCTO #9584] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: fix migrationsEd Bartosh
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: replace viewkeys() -> keys()Ed Bartosh
Python 3 doesn't have dict.viewkeys method, renaming to keys(). [YOCTO #9584] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-13toaster: bin Use python 3 for our django modules checkMichael Wood
Explicitly use python3 so that the modules for python3 are checked. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: BuildTasksTable filters remove outcome NA optionBelen Barros Pena
In the 'outcome' filter for tasks, remove the 'not applicable' option, since it should not be exposed to users. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: BuiltPackagesTable format empty state in packages tableBelen Barros Pena
The explanatory message in the empty state of the packages built table was missing some spaces. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: build data Fix left navigationBelen Barros Pena
Make sure the current page is always highlighted in the left navigation. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
2016-06-13toaster: port all build analysis pages to bootstrap 3Belen Barros Pena
Port all the pages in the build analysis area to bootstrap version 3. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: buildtables Remove links from non name fieldsBelen Barros Pena
Design change to have no links for non-named fields in BuiltPackagesTable. BuiltRecipesTables and BuildTasksTable. Additionally: - Fix class and elements for Bootstrap3 in help text. - Change title of InstalledPackages table to Packages Included. - Change which columns are default shown/hidden columns. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: fix typo which prevents filters from workingElliot Smith
'k' was replaced by 'key' at some point but not fixed in the body of the loop. This caused a failure when the the query was constructed for a filtered queryset, due to the variable not being defined. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toasterui: use BuildInit to capture builds with bad targetsElliot Smith
If a build has bad targets which cause bitbake to fail before BuildStarted is fired, we are unable to represent this in Toaster, as the build was not detected at all. Use the BuildInit event so we can capture these failures. BuildStarted is retained as the event which causes a build object to be created, to support older versions of bitbake which don't have BuildInit. [YOCTO #8440] Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13cooker: add BuildInit eventElliot Smith
In situations where a bitbake run fails before the build properly starts and BuildStarted is fired, a UI has no way to get at the targets passed to the build. This makes it difficult for the UI to report on the targets which failed. Fire a BuildInit event before running buildTargets() or buildFile(). This enables a UI to capture targets passed to buildTargets(), even if the build fails (e.g. the targets themselves are invalid). [YOCTO #8440] Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13toaster-tests: maximize browser window when running UI testsElliot Smith
In some pages of the UI, the UI tests failed because parts of the UI which should be visible were being reported as not visible by the Selenium PhantomJS driver. On investigation, it turns out that PhantomJS uses a very narrow default window. This meant that some parts of the UI were being clipped and were thus not "visible" to the driver, causing test failures (specifically, on the new custom image page). Ensure that the window is maximized before running tests to prevent this happening. Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13toaster: Rework displaying package dependencies across ToasterMichael Wood
After porting the build table to a unified mechanism for showing dependencies in tables it highlighted that the dependencies selected to be shown were un-filtered. i.e. all dependencies from all contexts were shown. The context for a package's dependencies is based on the target that they were installed onto, or if not installed then a "None" target. Depending on where the template for the dependencies are show we need to switch this target which is why a filter and utility function on the model is added. Additionally to use the same templates in the build analysis we also need to optionally add links to the build data for the packages being displayed as dependencies. Customising a Custom image recipes may or may not have a target depending on whether they have been built or not, if not we do a best effort at getting the dependencies by using the last known target on that package to get the dependency information. [YOCTO #9676] Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: widgets ToasterTable Catch template rendering exceptionsMichael Wood
If a cell template rendering causes an exception catch it and carry on, this at least allows the table to show the rest of the data if nothing else. Also improve the error logging so that it's possible what the offending template snippet was. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: tests Add new build tables to testsMichael Wood
- Add new build tables to be tested - Add required data into the fixture and clean up a few empty fields - Fix the SoftwareRecipesTable specific test so as not to rely on two particular defined recipes Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: table.js Add the ability to highlight a particular rowMichael Wood
As in the old build tables it's useful to jump and highlight a particular row in the table using the #hash in the URL. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: port Installed packages table to ToasterTableMichael Wood
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: port Task tables to ToasterTables widgetMichael Wood
Port the Task based tables to ToasterTable. This is the Task, Time, CPU usage and Disk I/O tables. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: port Built recipes table to toastertablesMichael Wood
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: port table for Built packages to ToasterTableMichael Wood
This is the table that displays all the packages built in the build. Build -> Packages. Adds a template snippet for the git revision popover. Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: ToasterTable widget add an 'a' to Name in Exception classMichael Wood
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: toaster tables Enable complex empty statesBelen Barros Pena
Make sure we can create empty states for toaster tables that include actions for users to get out of the empty state. Allows a template to be used as an empty state. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
2016-06-13toaster: Migrate project configuration from bootstrap 2 to bootstrap 3Belen Barros Pena
Convert all the HTML templates, JS and CSS in the project parts of toaster to use bootstrap 3. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: work-around our lack of a synchronous fetch for typeaheadsElliot Smith
The Twitter typeahead.js library expects the developer to use a source which does a local search for matching suggestions, then falls back to a remote search if that doesn't return enough results. However, in Toaster, we don't do any caching of the suggestions for a typeahead, so our source only works in asynchronous mode. Consequently, we see fewer than the expected number of suggestions if the typeahead has already shown suggestions matching a query. For example, searching for "meta-n" in the layers typeahead will show the results for this query; but when the query changes to "meta-ne", a new set of results is fetched, which mostly overlaps with the results for "meta-n". The typeahead assumes that the overlapping items are locally cached and have been delivered synchronously, and just appends the new results which don't overlap with the previous query. But because we don't provide any results synchronously, we just end up with the single non-overlapping result in the drop-down. This can be fixed by hacking typeahead.js so that instead of appending asynchronous results, we always overwrite and redraw the whole typeahead menu. This is a temporary fix, and should be properly fixed (when we have time), perhaps by using typeahead.js's associated Bloodhound library. Added a note about the hack to the license file as an explanation of why the unminified JS file is included in Toaster. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: migrate typeahead libraryElliot Smith
Migrate from Bootstrap 2's built-in typeahead to Twitter's typeahead library. This is to facilitate moving to Bootstrap 3, which doesn't have a typeahead. Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Michael Wood <michael.g.wood@intel.com>
2016-06-13toaster: tests Add a BuildTest helper classMichael Wood
Add a helper class for running build tests. Subclass this and call the build method to get setup for running tests on the resulting data from a build. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13toaster: tweaks to recipe file downloadsBelen Barros Pena
* In the custom images table, show the recipe file and download icon only when the recipe file exists and can be downloaded. * Also in the custom images table, make sure the download icon tooltip shows on hover. * In the custom image details page, show the correct icon (download) next to the recipe file in the right hand column. * In the custom image details page, show the recipe file and download icon in the right hand column only when the recipe file exists and can be downloaded * Also in the custom image details page, simplify the help text we show when the 'download' button is disabled: it gave so much information about what's actually happening under the hood that it was a bit hard to follow. Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13toaster: testsjs Add call back to append elements on completion of testsMichael Wood
When the tests are complete add some marker elements to the test page DOM which can then looked at for a selenium browser test. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com>
2016-06-13cooker.py: fix warn() -> warning()Robert Yang
Fixed: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-13data_smart/utils: Add 'd' to the context used for better_eval in python ↵Richard Purdie
expansion If a line like: foo=${@' '.join([d.getVar('D', True) + x for x in (' '.join([d.getVar('FILES_bash-' + p, True) or '' for p in ['lib', 'dev', 'staticdev', 'doc', 'locale', 'ptest']])).split()])} is added to a function like do_install, it fails with Exception name 'd' is not defined. This is due to a change of behaviour in python 3 compared to python 2. Generator expressions, dict comprehensions and set comprehensions are executed in a new scope but list comprehensions in python 2.x are not. In python 3 they all use a new scope. To allow these kinds of expressions to work, the easiest approach is to add 'd' to the global context. To do this, an extra optional parameter is added to better_eval and we use that to add 'd'. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-09lib/bb/main.py: Fix use of BBPOSTCONF and BBPRECONFMariano Lopez
The functionality of BBPOSTCONF and BBPRECONF was added in commit 21b314d4d1e5b8fbeb4cc57006f0a110f0b3aa8f but there was a typo in the variable name that raises an exception in bitbake. [YOCTO #9235] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03codeparser: Use hashlib for hashing, not hash()Richard Purdie
"hash() is randomised by default each time you start a new instance of recent versions (Python3.3+) to prevent dictionary insertion DOS attacks" which means we need to use hashlib.md5 to get consistent values for the codeparser cache under python 3. Prior to this, the codeparser cache was effectively useless under python3 as shown by performance regressions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03codeparser: Small optimisation to stop repeated hash() callsRichard Purdie
No functionality change, just avoids function call overhead in a function which loops heavily. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02fetch2: fix unpacking of deb packagesPaul Eggleton
deb packages in modern Debian versions have the data tarball compressed with xz rather than gzip, and thus explicitly extracting data.tar.gz fails. Unfortunately ar doesn't support wildcards matching items to extract, so we have to find out what the name of the file is first and then extract it, relying on tar to figure out how to unpack it based on the filename rather than doing it with pipes and making that determination ourselves. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02fetch2/git.py: References must match exactlyPeter Kjellerstedt
Previously the code used to match a reference to its SHA-1 in _latest_revision() used the Python "in" operator, which made it match if the reference matched the beginning of an existing tag or branch. This test, however, must be exact. I.e., either the reference matches a tag or branch exactly, or it does not match at all. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02cookerdata: print an error if layer dir does not existMarkus Lehtonen
Makes it easier for user to identify problems, e.g. typos, in BBLAYERS. [YOCTO #9507] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>