Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add E2E Testing for OpenCommit CLI in GitHub Actions #253

Draft
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

malpou
Copy link
Contributor

@malpou malpou commented Sep 8, 2023

This draft PR introduces end-to-end (E2E) tests for the OpenCommit CLI tool. The main goal of these tests is to simulate user interactions and ensure the tool functions as expected.

Key Points:

  • Tests are designed to be executed in GitHub Actions.
  • These tests will be triggered on all new pull requests to ensure robustness before merging.

Currently facing some challenges with the tests. Looking forward to discussing and resolving them with @di-sukharev.

The test-index.ts file was added to the project. This file contains a single line of code that logs "hello world" to the console.
✨ feat(commit.ts): add support for testing mode in the commit command to generate a test commit message
🐛 fix(generateCommitMessageFromGitDiff.ts): add a testing flag to the generateCommitMessageByDiff function to enable testing mode and generate a test commit message
🔧 chore(package.json): add Jest and related dependencies for testing purposes
🔧 chore(package.json): add test:e2e script to run end-to-end tests using Jest
…-end tests on pull requests

🔧 chore(oneFileFlow.test.ts): add test case for generating commit message for a single staged file
🔧 chore(noChanges.test.ts): add test case for running CLI flow to get the "No changes detected" message
🔧 chore(oneFileFlow.test.ts): add test case for generating commit message for multiple staged files
🔧 chore(oneFileFlow.test.ts): add test case for generating commit message for 1 changed file (not staged)
…for cleaner test code

🔧 chore(noChanges.test.ts): increase timeout for the test to ensure it has enough time to complete
@malpou malpou changed the base branch from master to dev September 8, 2023 11:01
@di-sukharev
Copy link
Owner

@malpou it's an honour to be part of the team with you <3

let me know what help you need and i will do my best to assist

@malpou
Copy link
Contributor Author

malpou commented Sep 9, 2023

You too, it's a fun project you have made!

I've started getting the tests to work locally (they still have some issues), but the blocker now is getting them to run consistent in the actions.
Currently I'm just getting a timeout on them, so something is hanging 🤷‍♂️

What are your thought of adding the --test flag that will just give us a generic test commit message instead of calling the API?

@di-sukharev
Copy link
Owner

@malpou

why do you think we need --test flag? i guess mocking openAI api isnt working in GitHub action, right?

@github-actions
Copy link

Stale pull request message

@di-sukharev
Copy link
Owner

@malpou hey brother, any blockers here i can help with?

Copy link

github-actions bot commented Dec 2, 2023

Stale pull request message

@di-sukharev
Copy link
Owner

@malpou im finally back, do you still want to finish this PR?

@di-sukharev
Copy link
Owner

@malpou <3 ping me when you have time, tests is all we need :) please pull the latest dev to solve conflicts

@malpou
Copy link
Contributor Author

malpou commented Mar 3, 2024

Hi @di-sukharev
I'm busy with other things at the moment so won't have time to finish this right now

@di-sukharev
Copy link
Owner

no worries man, thank you for all the contributions <3 <3 <3

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.

None yet

2 participants