Skip to main content

A Python package for regression testing with Google Sheets integration.

Project description

RegressionTesting

Copyright (c) 2025 Lionel Guo
Author: Lionel Guo
Email: lionelliguo@gmail.com
GitHub: https://github.com/lionelliguo/regressiontesting


🧩 Overview

RegressionTesting is a Python package for Automated Regression Testing with Google Sheets. This package allows you to:

  • Fetch and compare HTTP Status Line and Header Fields using curl commands stored in Google Sheets.
  • Process these commands and store results (PASS/FAIL) back to Google Sheets.
  • Automatically manage the testing process using batch updates and configurable settings.

Google Sheet Structure

1. TEST CASE Sheet (TEST CASE)

The TEST CASE sheet is used for storing the test scripts and their results. It contains the following columns:

  • CURL_1: Stores the first curl scripts for execution.
  • RESULT_1: Stores the HTTP Status Line and Header Fields returned by the first curl script. The HTTP Status Line and Header Fields listed in SELECTION_RULE_1 will not appear in RESULT_1.
  • CURL_2: Stores the second curl scripts for execution.
  • RESULT_2: Stores the HTTP Status Line and Header Fields returned by the second curl script. The HTTP Status Line and Header Fields listed in SELECTION_RULE_2 will not appear in RESULT_2.
  • STATUS: Stores the comparison results between RESULT_1 and RESULT_2. If the results match, it will be PASS, otherwise, it will be FAIL. The HTTP Status Line and Header Fields listed in COMPARISON_RULE will be excluded when checking if the results match.

Example:

CURL_1 RESULT_1 CURL_2 RESULT_2 STATUS
curl https://example1.com curl https://example2.com
curl https://example3.com curl https://example4.com

Each row represents one test case. You can add as many rows as needed for more test cases.

2. Config Sheet (CONFIG)

The CONFIG sheet defines selection and comparison rules for the HTTP Status Line and Header Fields. It contains the following columns:

  • SELECTION_RULE_1: Stores the HTTP Status Line and Header Fields that should be ignored during the first curl script execution. The HTTP Status Line and Header Fields will not appear in RESULT_1.
  • SELECTION_RULE_2: Stores the HTTP Status Line and Header Fields that should be ignored during the second curl script execution. The HTTP Status Line and Header Fields will not appear in RESULT_2.
  • COMPARISON_RULE: Stores the HTTP Status Line and Header Fields that should be ignored during the comparison between RESULT_1 and RESULT_2. The HTTP Status Line and Header Fields will be excluded when checking if the results match.

Example:

SELECTION_RULE_1 SELECTION_RULE_2 COMPARISON_RULE
Content-Length Content-Length Date
Content-Type Content-Type Server

You can add as many rows as needed for additional rules.


3. Automatic Creation of a New Sheet

Each time regression testing is executed, a new sheet is automatically created with the current date and time. The curl scripts from the TEST CASE sheet are copied into the new sheet.

The new sheet includes the following structure:

  • CURL_1 and CURL_2 from the original TEST CASE sheet.
  • New regression testing results are recorded for documentation and future reference.

⚙️ Requirements

  • Python 3.x
  • Required Python packages:
    pip3 install gspread google-auth google-auth-oauthlib regressiontesting
    
  • curl command-line tool
  • A valid Google Service Account JSON key

🚀 Setup

1. Clone repository

git clone https://github.com/lionelliguo/regressiontesting.git
cd regressiontesting

2. Install dependencies

pip3 install -r requirements.txt

🛠️ Configuration (settings.json)

Example configuration file:

{
  "SPREADSHEET_URL": "Your Google Spreadsheets URL",
  "SERVICE_ACCOUNT_FILE": "Your Google Service Account Key.json",
  "SLEEP_SECONDS": 1.0,
  "IGNORE_CASE": true,
  "COPY_BATCH_SIZE": 1,
  "OUTPUT_BATCH_SIZE": 1
}

Note:
0 means all in one batch — no batching process.


🌐 Google Sheets and Service Account Setup

1. Create a Google Sheet

  • Go to Google Sheets.
  • Create a blank spreadsheet (e.g., regressiontesting).
  • Share the sheet with your Service Account email.

2. Enable APIs

3. Create a Service Account

  • In IAM & Admin → Service Accounts, create a new account and download the JSON key file.

4. Share Sheet with Service Account

  • Open your Google Sheet → Share → add Service Account email.

▶️ Example Usage

After configuring settings.json, run the regression test and check the results in the Google Sheet.

python3 main.py

⚡ Quick Start

For a quick start, you can use the provided settings-sample.json instead of settings.json to quickly run the program.
You can also view the regression testing results directly at:
👉 Google Sheet Link


📄 License

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regressiontesting-2.0.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

regressiontesting-2.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file regressiontesting-2.0.0.tar.gz.

File metadata

  • Download URL: regressiontesting-2.0.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for regressiontesting-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cb707be8a0920da2cc83244c4e17c183794ff148a39f47cc5b73f91f78e3cf3c
MD5 ad4b1efd773b60a3a73585b0fe02f02b
BLAKE2b-256 56f702a26661113c7c18145dfaa15c4abe1f23f9a212ac4d57fc37df0cc3c73a

See more details on using hashes here.

File details

Details for the file regressiontesting-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for regressiontesting-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef06db946739b5ba28d4208c060d8545d01cc82e567712cbbf073af0db03786e
MD5 8f63af5087baa1aac1108b444359f273
BLAKE2b-256 1ed6aa205cbdbd8780d0a073ff005fca90d4d84dd47bb281f497247f8c01f23c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page