Ufotest

Latest version: v1.1.0

Safety actively analyzes 621724 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 6

2.0.0

------------------

**THIS VERSION BREAKS BACKWARDS COMPATIBILITY.** The compatibility is probably violated in several places, but the most
important change is probably a major change of how the test report html files are rendered. This will likely cause
the web interface of existing installations to be unusable

Fixes

- The "setup" and "teardown" script previously still used the old script system. Now they also use the camera class.
- The tests now also use the Camera class which is passed to them by the test runner and not the old method
- When using the "--mock" option, the "flash" command will not attempt to actually flash anything, the code is just
skipped
- The "flash" step of the build process now properly replicates the main process command line options "mock" and
"verbose" when invoking the "flash" command in a sub shell.
- Getting the most recent build is now based on the filesystem creation date of the folder and not the json report file
which may not exists yet at the moment of inquiry (This was a bug before)
- When the flashing process during a build fails, the build is not discarded but saved as a report nonetheless. The
test suite is still executed.
- A build script is not promised to be existing on the assumption that it "should" alone. The script manager now
actually checks if the script file exists.

Changes

- Added additional methods to be implemented for the interface "camera.AbstractCamera": "supports_prop", "set_prop" and
"get_prop" which can be used to manipulate internal properties of the camera.
- Added "camera.InternalDictMixin" which is a mixin, which implements the management of camera internal props by using
a central dict. Provides default implementations for the relevant abstract methods of
"camera.AbstractCamera"
- The "frame" command now uses the UfoCamera class to retrieve it's images.
- Added the module "noise.py" to the default list of camera tests. It is supposed to contain all those test cases which
are in some way concerned with the calculation of noise characteristics for the camera.
- Added "tests.noise.CalculateDarkPhotonTransferCurve" which sweeps different values for the cameras exposure time
and then calculates the noise for each one, plotting those results at the end.
- Added "tests.noise.MeasureNoiseMixin" which can be used for easy access to a method which wraps the measurement of
camera noise by taking two independent frames and then calculating the variance of the frame difference
- Changed the way the jinja template environment is managed: It is now also part of the main config singleton. And
a filter hook applies to the loaders which are registerd to this environment, allowing plugins to register custom
template folders.
- Changed the test report and the test context to now also have fields sensor, hardware and firmware version.
- Added a really convenient "--mock" option to the main ufotest command of the CLI. This will register a filter which
makes all subsequent code use the MockCamera class instead of the default UfoCamera class. By using this simple
option it should for example be possible to use every camera class compatible test case with the mock camera as well
from the command line.
- Added "ci recompile" command to the CLI. This command will render the test report html files again using the
information within the report.json file. This command exists for the case that config changes for the web interface
have been made. On default these would not be reflected within the static test report html files.
- Added "util.HTMLTemplateMixin" a mixin class which provides a default implementation of the "to_html" method.
- During a build, the cloned repository itself is now also completely copied into the build archive folder. This is
necessary to retrieve the scripts from that version later on.
- The test report template now creates a table of contents of sorts which consists of links that point to the
corresponding section of the html page with the detailed report about each test case
- Added a new test case "loaded_scripts" which checks if all scripts are indeed loaded as a build version from the
remote repository.
- Added a new test case "scripts_syntax" which checks the syntax of all loaded scripts.
- Extended the abstract base class AbstractScript with a default method "check_syntax" which can be overwritten by the
specific subclass implementations to implement custom syntax check routines for the corresponding script types. Did
this to enable it being used in the "scripts_syntax" test case. Already implemented it for the BashScript type. Also
this is optional with a default implementation.
- The home page now shows an additional widget for the disk usage of ufotest. Two fields: one for the used disk space
and one for the remaining available disk space on the host PC. This change was prompted by the fact, that now the
entire source repo is saved for every build. This *could* explode the disk usage rapidly so better to keep an eye on
it.
- Added a custom jinja filter "format_byte_size" which converts an integer amount of bytes into a pretty formatted
string of another byte related unit.

Hooks

- Added the action hook "pre_command_frame" which is called at the start of the "frame" CLI command.
- Added filter hook "camera_class" which will be used to retrieve the AbstractCamera subclass to use to interface with
the actual camera hardware.
- Added filter hook "home_recent_count" for the int amount of recent tests and builds to be displayed on the home page
of the web interface.
- Added filter hook "home_template" which allows to change the jinja template which is being used to display the home
page.
- Added filter hook "home_status_summary" which allows to modify the individual data fields which are displayed
in the summary box of the homepage
- Added filter hook "template_loaders" which allows to register custom plugin template files for jinja2 templates, so
that they will be appropriately discovered by the main system. Only if this is used, the plugin templates can extend
the native ufotest templates, which they should!
- Added action hook "modify_template_environment" which can be used to modify the main jinja Environment instance which
is used to render all the templates. This allows a plugin for example to define custom template globals and filters.

Web Interface

- Added "FontAwesome" to the static assets. This is a CSS/JS library for adding Icon support to a web site. These icons
are supposed to be used for the web interface of ufotest.
- Added "CodeMirror" to the static assets. This is a JS library which essentially adds a code editor widget, which can
be used to edit code of various languages complete with syntax highlighting... This will be used to implement the
TOML config file editor for the web interface.
- Added a new nav item "Config" which directs to a page where the config file can be viewed, edited and
then saved.
- Added actual content for the home page. The home page now displays some summary information about the ufotest
software itself, the hardware and the firmware for the currently connected camera. The information about the camera
is derived from the details of the most recent test report. Additionally, the home page will display lists of the
most recent test and build reports.
- Completely switched from plain CSS files to using SCSS for the static stylesheet assets of the web interface. These
will not be compiled in time though. They should be compiled during development so that the installable version of
ufotest can be shipped with the compiled CSS versions of those files.

Documentation

- Added "plugin.rst": In the future this should contain a minimal tutorial for how to setup a ufotest plugin.
- Extended "hooks.rst"
- Docstrings for "testing.TestRunner"
- Docstrings for "camera.AbstractCamera"
- Docstrings for "camera.MockCamera"
- Docstrings for "camera.UfoCamera"

TODO
----

Bugs:

Features:

- Add a widget to the home screen which shows how many GB the whole system is using.

- Make the builds be able to fail with a build error and properly highlight this in the ui!

- A command which lists the currently active plugins

- Change the default URL for pcitool installation
- Config file flash ID

- helpful error message when forgetting the ".git" for any repository url
- helpful error message when the wrong branch is specified for the CI repo or generally an error when the clone
process fails!
- Add information about the test suite to the builds list page.
- Better output for the "flash" command.
- Parameter for test cases encoded in their names. Could do it by colon separation or smth.
- Automatic generation of "datasheet" with some special characteristics...

1.2.2

------------------

Changes

- Added the action hook "pre_command" which is executed right at the start of every CLI command

Fixes

- The "init" command for creating the installation folder now actually also creates the plugins
folder.

1.2.1

------------------

Changes

- Added the filter hook "get_version" which modifies the version string for the project.

Fixes

- There was bug which invoked the init of the plugin system when attempting to make an initial installation of
ufotest using the "init" command, but the plugin system init requires a valid config file to exist, which presents a
deadlock and caused the program not to be able to be installed at all. This is fixed by preventing the
plugin system to be loaded for the init command.

1.2.0

------------------

Plugin System: This version introduces the initial implementation of the plugin system. The plugin system should make
it possible to write plugins for ufotest, which modify and extend it's core behaviour in a reversible, modular fashion
which does not require a permanent modification to the core source code.

- Added the module "plugin.py" which is supposed to contain all the code, which implements a plugin system for ufotest
- Added the class "plugin.PluginManager". During construction of the config singleton a new instance of plugin manager
is created as the config attribute "pm". It then loads all plugins from a folder which is specified in the config
option "general" -> "plugin_folder". These plugins can register callbacks to action and filter hooks which will then
be executed within ufotests routines at those points where the respective action and filter hooks are being called
- Added the module "hooks.py", which contains the two classes "hooks.Action" and "hooks.Filter". These classes act as
decorators which can be used in plugins to register functions as hook callbacks
- Added a section "hooks" to the project docs, which will contain a listing and description of all available hooks for
plugin development.
- Added the test module "test_plugin.py" with unittests for the plugin system.

Script Management: The basic script management has been rewritten with a more extensive system for managing the scrips.
This new system was designed with two goals in mind: (1) The camera interaction scripts are supposed to be subject to
the CI version control itself and (2) The script behavior should be modifyable by hooks.

- Reworked the module "scripts.py"
- Added the class "scripts.ScriptManager" which will be the central hub for loading the scripts and for interacting
with them (by invoking them for example). An instance of this script manager will be part of the config singleton and
thus accessible from anywhere.
- Added the class "scripts.AbstractScript" as an abstract base class for specific implementations of script wrapper
classes, which internally wrap the functionality of interacting with different kinds of scripts.
- Added the class "scripts.BashScript" as an initial implementation for a script wrapper for interacting with simple
bash scripts.
- Added the test module "test_script.py" with unittests for the script management system.
- Added the fallback scripts "hello_world.sh" for testing purposes only

Changes

- The main "config.Config" singleton was changes quite a bit: This singleton now also manages instances of the plugin
manager and the script manager. These instances cannot be created in the constructor of Config because they rely on
the config file itself. They are initialized by calling the "prepare" method externally. This should happen as far in
the runtimes start as possible!
- Removed the two cli commands "script" and "list_scripts" in favor of the reworked script management system.
- Updated the README.rst to now also contain instructions for the installation of the project dependencies using either
the "install" command or the "install-all" command.

1.1.2

------------------

Changes

- All the installation methods for the repository requirements are now updated to return a dict with information about
the installation process and should thus work now with the "install" command
- Added the "install-all" command. Since the install command is now used to install individual dependencies, this
command can be used to install all of the dependencies and the required system packages all at once.

1.1.1

------------------

Changes

- Added "Development" section to the README
- Changed the "_testing.UfotestTestCase" to be a mixin "_testing.UfotestTestMixin" instead of a inherited child
class of TestCase, because that caused unnecessary duplication of test methods and a Bug during testing.
- Added a test file for the CLI
- Updated "install.install_pcitools" function to return result dict, use verbose and force fields of config
- Reworked command "install". It now accepts two arguments, where the first one is the string name of the dependency
to install and the second one is the path into which to install. This command is now used to install individual
dependencies. The full installation will be made with another command.
- Changed "testing.FigureTestResult" to save the matplotlib figure with minimal
whitespace


Bug fixes

- The "reload" method of Config overwrites the values and thus gets rid of the "context" field which is
only set in the constructor of the class.
- Fixed all the test cases, such that they *should* all pass now.
- "tests.frame.AcquireSingleFrame" fails because a call to plt.subplots gets the wrong parameters.
- "tests.frame.AcquireSingleFrame" fails sometimes if the pixel values are too homogeneous and the difference of the
0.1 and 0.9 quantile values comes down to zero. The procedure to increase contrast then causes a division by
zero exception

Page 1 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.