Skip to content

Conversation

@soul2zimate
Copy link
Contributor

@soul2zimate soul2zimate commented Feb 4, 2026

User description

Add missing environment variable to Python_Provider_Test.

CI fails when PR is triggered by pr.yml file where retrieves env var like RUN_PYTHON_BIN: ${{ vars.RUN_PYTHON_BIN }} since the repo variable defines true for RUN_PYTHON_BIN

 Error:  Errors: 
Error:    Python_Provider_Test.test_the_provideComponent:105 » PackageNotInstalled Package name=>anyio is not installed on your python environment, either install it ( better to install requirements.txt altogether) or turn on environment variable TRUSTIFY_DA_PYTHON_VIRTUAL_ENV=true to automatically install it on virtual environment (will slow down the analysis)
Error:    Python_Provider_Test.test_the_provideComponent:105 » PackageNotInstalled Package name=>anyio is not installed on your python environment, either install it ( better to install requirements.txt altogether) or turn on environment variable TRUSTIFY_DA_PYTHON_VIRTUAL_ENV=true to automatically install it on virtual environment (will slow down the analysis)

PR Type

Tests


Description

  • Replace environment variable check with system property annotation

  • Use PythonControllerBase.PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV property

  • Add @RestoreSystemProperties to restore state after test


Diagram Walkthrough

flowchart LR
  A["@EnabledIfEnvironmentVariable<br/>RUN_PYTHON_BIN"] -- "replaced by" --> B["@SetSystemProperty<br/>PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV"]
  B --> C["@RestoreSystemProperties"]
Loading

File Walkthrough

Relevant files
Tests
Python_Provider_Test.java
Replace environment variable with system property annotations

src/test/java/io/github/guacsec/trustifyda/providers/Python_Provider_Test.java

  • Replaced @EnabledIfEnvironmentVariable annotation with
    @SetSystemProperty
  • Changed from checking RUN_PYTHON_BIN environment variable to setting
    system property
  • Added @RestoreSystemProperties annotation to clean up system
    properties after test
  • Uses PythonControllerBase.PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV constant
    for property key
+2/-1     

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 4, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Feb 4, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Use valid virtualenv path

In the @SetSystemProperty annotation, replace the value "true" with a valid path
to a Python virtual environment for the PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV key.

src/test/java/io/github/guacsec/trustifyda/providers/Python_Provider_Test.java [87-88]

-@SetSystemProperty(key = PythonControllerBase.PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV, value = "true")
+@SetSystemProperty(key = PythonControllerBase.PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV, value = "src/test/resources/venv")
 @RestoreSystemProperties
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies that the property PROP_TRUSTIFY_DA_PYTHON_VIRTUAL_ENV likely expects a file path, not the boolean-like string "true", which could cause the test to fail.

Medium
  • Update

@soul2zimate soul2zimate changed the title fix: test fix attempt fix: add missing environment variable to test Feb 4, 2026
@soul2zimate soul2zimate requested a review from ruromero February 4, 2026 09:36
@soul2zimate soul2zimate merged commit ff999bc into guacsec:main Feb 4, 2026
24 of 39 checks passed
@soul2zimate soul2zimate deleted the test branch February 4, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants