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

Gh test #46

Merged
merged 35 commits into from
Oct 13, 2022
Merged

Gh test #46

merged 35 commits into from
Oct 13, 2022

Conversation

nilesh05apr
Copy link
Contributor

Implement a github action to check unit tests #33

Fresh PR for the above task.

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need several improvements in this action, Let's work on it step by step. 😊

.github/workflows/test.yml Show resolved Hide resolved
Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏
Now we have to run check.sh script instead of running pytest directly in the workflow. I have implemented the required checks in that script, please take a look.

Also, I could not check the cache hit, could you please double-check and make sure caching is working 😊

@nilesh05apr
Copy link
Contributor Author

@sudiptob2 i have manually re checked, all jobs are running fine and cache hit also successful. Now i need to work on running the bash script in the workflow.
Please check and review the progress.

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to run pytest, its already inside the check.sh

.github/workflows/test.yml Outdated Show resolved Hide resolved
@sudiptob2
Copy link
Owner

@nilesh05apr I think if you could use pipenv and install dependencies using Pipfile then you need not to install these dev dependencies manually.
Because these dev dependencies are not mentioned in the requirements.txt, it's a hassle to install them one by one in the ghithub actions manually.
if you use pipenv then you can just do

run: pipenv install --dev --verbose

see this github action for example.

@nilesh05apr
Copy link
Contributor Author

@sudiptob2 i updated the code but the problem for check.sh remains same.

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems better now, But we still have errors right?
below checks might help.
caching : run the action multiple time and confirm that the cache is working
check.sh: I can see this script is failing, I suppose, I was using python as interpreter may be python3 is needed. Also maybe we need to install the missing stubs

@nilesh05apr
Copy link
Contributor Author

for the caching part i will re run the jobs as many times as required but for the check.sh file i am unable to find and helpful resource.

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, these changes are goin to the wrong direction, your previous commit was OK, just it might need to install some stub packages, you can revert these changes and I will try to check it myself and you know If I can fix it.

@nilesh05apr
Copy link
Contributor Author

the problem is caching is also not working properly i have checked several times, can you please comment?

@sudiptob2
Copy link
Owner

the problem is caching is also not working properly i have checked several times, can you please comment?

Ok, just keep this PR at the previous commit, I will test and update you if I can find anything. You can always do experiments in a separate branch right.

@nilesh05apr
Copy link
Contributor Author

sure that i can do, i will create a new branch and try experimenting. Thanks

@sudiptob2
Copy link
Owner

I have implemented/fixed the workflow, see here

you can update your PR with the this code

@nilesh05apr
Copy link
Contributor Author

Thanks so much @sudiptob2 for the help. I have implemented the changes and have ensured everything is running smoothly.

@nilesh05apr nilesh05apr marked this pull request as ready for review October 13, 2022 02:06
@nilesh05apr
Copy link
Contributor Author

@ can you please review and merge the pull request. Thank you

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few small differences from what I implemented here
I might have miss a few thing while reviewing this, I would suggest you copy and paste the entire code from here to your file

uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Python version
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a space before this line

@@ -0,0 +1,52 @@
name: Test
on:
- pull_request
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- pull_request

name: Test
on:
- pull_request
- push
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- push

.github/workflows/test.yml Show resolved Hide resolved
uses: actions/cache@v2
id: cache-dependencies
with:
path: ./.venv
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path: ./.venv
path: .venv

@nilesh05apr
Copy link
Contributor Author

@sudiptob2 i have copy-pasted the code XD. please review the changes

Copy link
Owner

@sudiptob2 sudiptob2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems OK

@sudiptob2 sudiptob2 marked this pull request as draft October 13, 2022 04:54
@sudiptob2 sudiptob2 marked this pull request as ready for review October 13, 2022 04:54
@sudiptob2 sudiptob2 marked this pull request as draft October 13, 2022 05:03
@sudiptob2 sudiptob2 marked this pull request as ready for review October 13, 2022 05:03
@nilesh05apr
Copy link
Contributor Author

Thank you @sudiptob2 i had great experience working on this issue.

@sudiptob2 sudiptob2 merged commit 4f1f538 into sudiptob2:main Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants