Add Rhai scripting support for SAL #5

Merged
MahmoudEmad merged 12 commits from development_tests into main 2025-05-09 07:49:48 +00:00
Member

Add Test Suite for Rhai Modules

Overview

This PR adds a comprehensive test suite for all Rhai modules in the SAL library. The tests are designed to verify the functionality of each module and ensure that they work correctly on Ubuntu. The PR also includes detailed documentation for each module's tests.

Changes

New Test Scripts

Added test scripts for the following modules:

  • OS Module: File system, download, and package management operations
  • Git Module: Git repository management and operations
  • Process Module: Command execution and process management
  • Redis Client Module: Redis connection and operations
  • Text Module: Text manipulation, normalization, replacement, and template rendering
  • Buildah Module: Container and image operations
  • Nerdctl Module: Container and image operations using nerdctl
  • RFS Module: Remote filesystem operations and filesystem layers

Test Structure

Each module's tests are organized into:

  1. Individual test scripts for specific functionality
  2. A runner script that executes all tests for the module
  3. Proper cleanup to ensure tests don't leave artifacts

Documentation

Added detailed documentation for each module's tests, including:

  • Test structure and organization
  • Instructions for running tests
  • Detailed descriptions of what each test verifies
  • Requirements and dependencies
  • Best practices for writing new tests

Graceful Dependency Handling

All tests are designed to gracefully handle cases where dependencies are not available:

  • Tests check for required tools before running
  • Tests skip (rather than fail) when dependencies are missing
  • Clear reporting of skipped tests with reasons

Testing

All tests have been verified to run successfully on Ubuntu. Tests that require external tools (Redis, Nerdctl, Buildah, RFS) gracefully skip when those tools are not available.

To run all tests:

./run_rhai_tests.sh

To run tests for a specific module:

herodo --path src/rhai_tests/[module]/run_all_tests.rhai

Test execution summary showing all tests passing:

=======================================
Total modules tested: 8
Passed: 8
Failed: 0

All tests passed!
=======================================
# Add Test Suite for Rhai Modules ## Overview This PR adds a comprehensive test suite for all Rhai modules in the SAL library. The tests are designed to verify the functionality of each module and ensure that they work correctly on Ubuntu. The PR also includes detailed documentation for each module's tests. ## Related Issues - https://git.ourworld.tf/herocode/sal/issues/2 - https://git.ourworld.tf/herocode/sal/issues/3 ## Changes ### New Test Scripts Added test scripts for the following modules: - **OS Module**: File system, download, and package management operations - **Git Module**: Git repository management and operations - **Process Module**: Command execution and process management - **Redis Client Module**: Redis connection and operations - **Text Module**: Text manipulation, normalization, replacement, and template rendering - **Buildah Module**: Container and image operations - **Nerdctl Module**: Container and image operations using nerdctl - **RFS Module**: Remote filesystem operations and filesystem layers ### Test Structure Each module's tests are organized into: 1. Individual test scripts for specific functionality 2. A runner script that executes all tests for the module 3. Proper cleanup to ensure tests don't leave artifacts ### Documentation Added detailed documentation for each module's tests, including: - Test structure and organization - Instructions for running tests - Detailed descriptions of what each test verifies - Requirements and dependencies - Best practices for writing new tests ### Graceful Dependency Handling All tests are designed to gracefully handle cases where dependencies are not available: - Tests check for required tools before running - Tests skip (rather than fail) when dependencies are missing - Clear reporting of skipped tests with reasons ## Testing All tests have been verified to run successfully on Ubuntu. Tests that require external tools (Redis, Nerdctl, Buildah, RFS) gracefully skip when those tools are not available. To run all tests: ```bash ./run_rhai_tests.sh ``` To run tests for a specific module: ```bash herodo --path src/rhai_tests/[module]/run_all_tests.rhai ``` Test execution summary showing all tests passing: ``` ======================================= Total modules tested: 8 Passed: 8 Failed: 0 All tests passed! ======================================= ```
MahmoudEmad added 1 commit 2025-05-08 11:34:02 +00:00
- Add Rhai scripting integration to the SAL library.
- Create documentation for Rhai module usage and available functions.
- Implement comprehensive test suite for the Rhai integration.
- Add `.gitignore` entries for test related temporary files.
MahmoudEmad added 1 commit 2025-05-08 12:05:32 +00:00
- Added documentation for the Git module's test scripts, including
  test structure, running instructions, and details of each test.
- Added links to Git module tests in the main Rhai documentation.
- Improved overall structure and clarity of the Rhai documentation.
MahmoudEmad added 1 commit 2025-05-08 12:06:02 +00:00
- Added a comprehensive guide on running Rhai tests within the
  SAL library.  This includes instructions for running all tests,
  tests for specific modules, and individual tests.
- Created a shell script (`run_rhai_tests.sh`) to simplify running
  all Rhai tests and provide a summary of results.  This improves
  the testing workflow and makes it easier to identify failures.
MahmoudEmad added 1 commit 2025-05-08 12:09:22 +00:00
ci: Add CI workflow for Rhai tests
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
4578b10acb
- Added a GitHub Actions workflow to automatically run Rhai tests on
  push and pull request events.
- Created documentation for the CI workflow.
- Improved test runner script to log output to a file and check for
  test failures.
MahmoudEmad added 1 commit 2025-05-08 12:54:46 +00:00
docs: Add documentation for Process module tests
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
32217b6545
- Added documentation for the new Process module tests, including
  details on test structure, execution, and individual test
  descriptions.
- Created new documentation files for Process module tests.
- Updated the main Rhai documentation index to include the new
  Process module tests.
MahmoudEmad added 1 commit 2025-05-08 13:32:58 +00:00
feat: Add Redis client module and tests
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
1286939608
- Add a new Redis client module to the SAL library.
- Implement Rhai wrappers for Redis connection and operations.
- Add comprehensive test suite for the Redis client module.
- Update documentation to include Redis client module details.
- Add .gitignore entries to exclude test logs and files.
MahmoudEmad added 1 commit 2025-05-08 14:00:34 +00:00
feat: Add text module tests to SAL
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
4897eb9133
- Add new test suite for text manipulation functions.
- Extend documentation with details on new text module tests.
- Add .gitignore entry for test template files.
MahmoudEmad added 1 commit 2025-05-08 14:11:34 +00:00
feat: Add Buildah module tests to Rhai integration tests
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
83662736c0
- Added comprehensive test suite for Buildah module functionality.
- Included tests for Builder pattern, image operations, and
  container operations.
- Added documentation describing test structure, execution, and
  details.
MahmoudEmad added 1 commit 2025-05-08 14:48:08 +00:00
docs: Add documentation for Nerdctl and RFS module tests
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
d3c645e8e6
- Added documentation for Nerdctl module tests, detailing test
  structure, running instructions, and individual test cases.
- Added documentation for RFS module tests, covering test
  structure, running instructions, and individual test cases.  These
  tests verify remote filesystem operations and filesystem layer
  management.
MahmoudEmad added 1 commit 2025-05-09 06:45:58 +00:00
feat: Add PostgreSQL and Redis client support
Some checks failed
Rhai Tests / Run Rhai Tests (push) Waiting to run
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
f002445c9e
- Add PostgreSQL client functionality for database interactions.
- Add Redis client functionality for cache and data store operations.
- Extend Rhai scripting with PostgreSQL and Redis client modules.
- Add documentation and test cases for both clients.
MahmoudEmad added 1 commit 2025-05-09 06:54:43 +00:00
feat: Improve package management and testing
Some checks failed
Rhai Tests / Run Rhai Tests (push) Has been cancelled
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
22f87b320e
- Improve platform detection logic for more robust package management.
- Enhance error handling and reporting in package commands.
- Refactor code for better readability and maintainability.
- Add comprehensive tests to cover package management functionality.
- Improve test coverage for various scenarios and edge cases.
MahmoudEmad added 1 commit 2025-05-09 07:45:59 +00:00
feat: Add PostgreSQL connection pooling support
Some checks failed
Rhai Tests / Run Rhai Tests (pull_request) Has been cancelled
114d63e590
- Implement connection pooling using `r2d2` and `r2d2_postgres`
- Add connection pool configuration options to `PostgresConfigBuilder`
- Introduce transaction functions with automatic commit/rollback
- Add functions for executing queries using the connection pool
- Add `QueryParams` struct for building parameterized queries
- Add tests for connection pooling and transaction functions
MahmoudEmad merged commit 663367ea57 into main 2025-05-09 07:49:48 +00:00
MahmoudEmad deleted branch development_tests 2025-05-09 07:50:01 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: herocode/sal#5
No description provided.