Cloud Testing Overview

Modern applications run on cloud infrastructure. QA engineers must understand cloud-specific testing services, device farms for cross-platform testing, and patterns for testing cloud-native applications.

Testing Services by Cloud Provider

AWS Testing Services

ServicePurpose
AWS Device FarmReal device and browser testing
AWS CodePipelineCI/CD pipeline
AWS CodeBuildBuild and test execution
LocalStackLocal AWS service emulation (third-party)
AWS Fault Injection SimulatorChaos engineering
Amazon CloudWatchMonitoring and alerting

GCP Testing Services

ServicePurpose
Firebase Test LabReal device testing (Android, iOS)
Cloud BuildCI/CD pipeline
Cloud MonitoringMetrics and alerting
Cloud LoggingLog aggregation
Google Cloud DeployContinuous delivery

Azure Testing Services

ServicePurpose
Azure DevOps PipelinesCI/CD with built-in test management
App Center TestReal device testing
Azure MonitorMonitoring and diagnostics
Azure Load TestingCloud-hosted load testing
Azure Test PlansManual and exploratory test management

Cloud Device Farms

AWS Device Farm

# GitHub Actions with AWS Device Farm
- name: Run on AWS Device Farm
  uses: aws-actions/configure-aws-credentials@v4
  with:
    aws-access-key-id: ${{ secrets.AWS_KEY }}
    aws-secret-access-key: ${{ secrets.AWS_SECRET }}

- name: Upload and run tests
  run: |
    aws devicefarm create-upload --project-arn $PROJECT_ARN --name tests.zip --type APPIUM_NODE_TEST_PACKAGE
    aws devicefarm schedule-run --project-arn $PROJECT_ARN --device-pool-arn $POOL_ARN --test type=APPIUM_NODE,testPackageArn=$TEST_ARN

Firebase Test Lab

# Run on Firebase Test Lab
- name: Run Instrumented Tests
  run: |
    gcloud firebase test android run \
      --type instrumentation \
      --app app/build/outputs/apk/debug/app-debug.apk \
      --test app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
      --device model=Pixel6,version=33 \
      --device model=Pixel4,version=30

Local Cloud Emulation

LocalStack for AWS

# docker-compose.yml
services:
  localstack:
    image: localstack/localstack
    ports:
      - "4566:4566"
    environment:
      - SERVICES=s3,sqs,dynamodb,lambda
      - DEFAULT_REGION=us-east-1

  tests:
    build: .
    environment:
      - AWS_ENDPOINT_URL=http://localstack:4566
      - AWS_ACCESS_KEY_ID=test
      - AWS_SECRET_ACCESS_KEY=test
    depends_on:
      - localstack

GCP Emulators

# Start Pub/Sub emulator
gcloud beta emulators pubsub start --project=test-project

# Start Firestore emulator
gcloud beta emulators firestore start

# Start Datastore emulator
gcloud beta emulators datastore start

Cloud-Native Testing Patterns

Testing Serverless Functions

// Test AWS Lambda locally with SAM
// sam local invoke "MyFunction" -e event.json

// Or test the handler directly
import { handler } from './index.mjs';

test('Lambda handler processes event correctly', async () => {
  const event = { body: JSON.stringify({ userId: '123' }) };
  const result = await handler(event);
  expect(result.statusCode).toBe(200);
});

Testing with Managed Services

When your application uses managed services (RDS, DynamoDB, Cloud SQL), test against local equivalents:

Cloud ServiceLocal Alternative
AWS S3LocalStack, MinIO
AWS DynamoDBLocalStack, DynamoDB Local
AWS SQSLocalStack, ElasticMQ
GCP Pub/SubGCP Emulator
GCP FirestoreGCP Emulator
Azure Cosmos DBCosmos DB Emulator

Exercise: Design a Multi-Cloud Testing Strategy

Your application uses AWS Lambda, S3, and DynamoDB. It is deployed across AWS (primary) and GCP (failover). Design a testing strategy covering both clouds.

Solution

Local Testing

  • LocalStack for AWS services (Lambda, S3, DynamoDB)
  • GCP emulators for Pub/Sub and Firestore
  • Docker Compose orchestrates all emulators + application

CI Testing

  • Unit tests: mock AWS SDK and GCP SDK
  • Integration tests: LocalStack + GCP emulators in Docker
  • Lambda function tests: AWS SAM local invoke

Staging Testing

  • Dedicated AWS staging account with real services
  • Dedicated GCP staging project
  • E2E tests against both cloud environments
  • Failover testing: disable AWS staging, verify GCP handles traffic

Production Testing

  • Synthetic monitoring: critical paths on both clouds
  • Cross-cloud latency monitoring
  • Failover drill: monthly test of AWS → GCP switchover

Key Takeaways

  1. Each cloud provider has unique testing services — choose based on your stack
  2. Local emulation reduces costs and speeds up testing — LocalStack, GCP emulators
  3. Cloud device farms enable real-device testing at scale without maintaining hardware
  4. Serverless testing requires different patterns — test handlers directly, use local runtimes
  5. Multi-cloud testing adds complexity — invest in local emulation and cross-cloud E2E tests