Welcome to the "Unit Testing, CI, and Communication" repository. This project illustrates writing unit tests for a simple Python application, automating tests using GitHub Actions, and integrating Slack for effective communication.
Before you begin, make sure you have the following prerequisites:
- Basic Python programming knowledge
- Familiarity with version control (Git & GitHub)
- Slack installed on your device
-
Clone the repository to your local machine:
- Clone with SSH
git clone git@github.com:kadimasum/unit-testing-ci-communication.git
- Clone with HTTPS
git clone https://github.com/kadimasum/unit-testing-ci-communication.git
-
Change to the project directory:
cd unit-testing-ci-communication
Explore the phonebook.py
file to understand the basic structure of the Phonebook class. The phonebook_test.py
file contains unit tests for this class. To run the tests locally:
python3 phonebook_test.py
The project is configured with GitHub Actions for automated testing on every push and pull request. The workflow is defined in the .github/workflows/ci.yml
file. It includes steps to:
- Check out the code
- Set up the Python environment
- Run the unit tests
- Notify on Slack for both success and failure scenarios
To receive notifications on Slack, follow these steps:
-
Set up a Slack Incoming Webhook. Refer to the Slack documentation for instructions.
-
Add the Slack Webhook as a secret in your GitHub repository:
- Go to "Settings" -> "Secrets" -> "New repository secret"
- Name:
SLACK_WEBHOOK
- Value: [Your Slack Webhook URL]
Now, when the CI workflow runs, it will send notifications to the configured Slack channel.
We encourage contributions! If you have suggestions, enhancements, or bug fixes, please open an issue or submit a pull request.
This project is licensed under the MIT License.