Skip to content

test: add comprehensive end-to-end mocked tests for all cloud scanners - #30

Merged
shlok926 merged 4 commits into
mainfrom
fix/ci-python-version
Sep 7, 2026
Merged

test: add comprehensive end-to-end mocked tests for all cloud scanners#30
shlok926 merged 4 commits into
mainfrom
fix/ci-python-version

Conversation

@shlok926

@shlok926 shlok926 commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Overview

This PR introduces a complete, end-to-end testing suite for SentinelRecon's cloud scanners (AWS, Azure, and GCP) and the Orchestrator, ensuring stable deployments without requiring live cloud credentials or incurring costs.

Changes Included

  • AWS Mocking (moto): Added moto[all] to dependencies to simulate an AWS environment locally.
  • S3 & EC2 Scanners Tested: Created test_aws_scanners.py to verify detection logic for unencrypted buckets, public buckets, and insecure EC2 instances.
  • Azure & GCP Scanners Tested: Created test_cloud_scanners.py utilizing pytest-mock to mock ComputeManagementClient and GCP's InstancesClient. Verifies correct parsing of Azure VMs/Storage and GCP Instances.
  • Orchestrator End-to-End Test: Created test_orchestrator_e2e.py to mock all underlying SDKs and test the full Orchestrator.execute_scan() data aggregation flow.
  • CI/CD Fixes: Updated .github/workflows/tests.yml to install moto[all], ensuring these new tests run perfectly on the GitHub Actions Linux runner.
  • Environment Updates: Updated requirements.txt and created .env.example so users can easily authenticate if they wish to run real tests.

Why This Matters

Achieves complete test coverage of our business logic and prevents future regressions in our cloud scanning code. New contributors can now run pytest to fully validate their changes instantly without complex cloud setups!

@shlok926
shlok926 merged commit 5ff67e4 into main Sep 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant