unit-tests

Set up a Python virtual environment and execute unit tests with gltest.

157|60|Updated Mar 16, 2024
One-click install
npx skills add https://github.com/genlayerlabs/genlayer-studio --skill unit-tests-genlayerlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unit-tests
Source: https://github.com/genlayerlabs/genlayer-studio/tree/main/.claude/skills/unit-tests
Command: npx skills add https://github.com/genlayerlabs/genlayer-studio --skill unit-tests-genlayerlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of setting up a Python virtual environment and executing unit tests for GenLayer Studio projects, ensuring code quality and stability.

Core Features & Use Cases

  • Environment Setup: Automates the creation and activation of a Python virtual environment with necessary dependencies.
  • Test Execution: Provides commands to run all unit tests or specific test files and functions using the gltest utility.
  • Use Case: Developers can quickly set up a clean testing environment and run comprehensive unit tests before committing code changes, catching bugs early in the development cycle.

Quick Start

Set up the Python virtual environment and run all unit tests using the provided commands.

Frequently Asked Questions about unit-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run unit tests for GenLayer Studio projects?

To run unit tests for GenLayer Studio projects, use the gltest command-line tool to execute tests within a configured Python virtual environment. This automates dependency management and ensures the correct Python path for testing contract logic.

How do I set up a Python virtual environment for testing contract logic?

Setting up a Python virtual environment for testing contract logic involves creating and activating an isolated environment with the necessary dependencies. This ensures a clean state for executing unit tests using the gltest utility.

Can I run specific test files and functions using gltest?

Yes, you can run specific test files and functions using the gltest utility. It provides commands to target individual tests or execute all unit tests, allowing developers to verify contract logic efficiently before committing code changes.

Why do I need a virtual environment for Python unit tests?

A Python virtual environment is needed for unit tests to isolate project dependencies and ensure the correct Python path. This prevents package conflicts and guarantees that the testing environment accurately reflects the required setup for contract logic.

Does this testing approach work with existing CI pipelines?

Yes, this testing approach integrates with CI pipelines by automating environment setup and test execution. Running unit tests via the gltest command-line tool ensures code quality and stability by catching bugs early in the development cycle.