Skip to main content

OSLC Analyser for Unite

Project description

unic4py

unic4py is a Python module intended as an adapter for transforming non-interactive command-line analysis tools to OSLC-compliant web services


Installation

To use unic4py, install it using pip:

pip install unic4py

Additionally, ensure that the oslc4py-client and oslc4py-domains-auto dependencies are installed:

pip install oslc4py-client oslc4py-domains-auto

Features

The unic4py module includes the following main classes:

  1. UniteAnalyser: A utility class for registering, compiling, and analyzing systems under test (SUTs).
  2. SUT: A resource representation of a system under test, designed with OSLC principles.

Example Usage

Using UniteAnalyser for Compilation and Analysis

from unic4py.UniteAnalyser import UniteAnalyser

# Initialize the UniteAnalyser with the server's base URL and ports
analyser = UniteAnalyser("http://example.com", "8081", "8080")

# Set up compilation and analysis arguments
analyser.add_compilation_argument("sourceBase64", "encoded_source_code_here")
analyser.add_analysis_argument("SUT", "http://example.com:8080/compilation/services/resources/sUTs/155")

# Specify the analysis tool to use
analyser.pass_data['analysis_tool'] = "infer"

# Run the analysis
analyser.analyse()

UniteAnalyser Class

The UniteAnalyser class automates the process of registering, compiling, and analyzing SUTs. It uses the OSLCPythonClient for communicating with OSLC servers.

Methods

__init__

def __init__(self, unite_url, compilation_port, analysis_port)
  • Initializes the analyser with the base URL and ports for compilation and analysis services.

add_compilation_argument

def add_compilation_argument(self, name, value)
  • Adds an argument for the compilation process.

add_analysis_argument

def add_analysis_argument(self, name, value)
  • Adds an argument for the analysis process.

analyse

def analyse(self)
  • Executes the full pipeline: registering the SUT, checking its registration, performing the analysis, and retrieving the result.

register_sut

def register_sut(self)
  • Registers the system under test (SUT) using a compilation request.

check_sut_registration

def check_sut_registration(self)
  • Verifies the SUT registration by polling the compilation results.

perform_analysis

def perform_analysis(self)
  • Sends an analysis request for the registered SUT.

get_analysis_result

def get_analysis_result(self)
  • Retrieves the results of the analysis.

SUT Class

The SUT class represents a System Under Test resource and provides properties for working with OSLC-compliant resources.

Key Properties

  • launch_command: The command used to launch the system under test.
  • build_command: The command used to build the system under test.
  • title: The title of the system under test.
  • description: A description of the system under test.
  • identifier: A unique identifier for the system under test.
  • sut_directory_path: Path to the directory containing the SUT.
  • compiled: Indicates whether the SUT has been compiled.
  • produced_by_automation_request: Link to the automation request that produced this SUT.

Notes

  • Ensure the OSLC4PY_ACTIVE_INSTALLED_DOMAINS or OSLC4PY_EXTRA_DOMAINS_DIR environment variables are set if additional class discovery is needed.
  • Dependencies:
    • oslc4py-client
    • oslc4py-domains-auto

Install dependencies using:

pip install oslc4py-client oslc4py-domains-auto

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unic4py-0.1.3.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unic4py-0.1.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file unic4py-0.1.3.tar.gz.

File metadata

  • Download URL: unic4py-0.1.3.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for unic4py-0.1.3.tar.gz
Algorithm Hash digest
SHA256 cfa259e6628ae77fbfe039ce01646a65f6a09ecbc248ec2d0d5bdfca9fce9635
MD5 224147ee4fbba2d2990c786d6fe65197
BLAKE2b-256 caba190d0472f8883da14b33c75c5ee5a88b540b066029e70aaf3d42ef480ab8

See more details on using hashes here.

File details

Details for the file unic4py-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: unic4py-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.0

File hashes

Hashes for unic4py-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5fb7952867065b844dfe1dbc3e2da72d03f0b334549c6e7a67c4f8d70788f9fb
MD5 32c9555a6263cd76888a75f7f7044514
BLAKE2b-256 fb00d51e532ad3013a0291ceb8930a0c4a6a2164c80f1b5cae285af4be1ac00a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page