Bouni / python-luxtronik

python-luxtronik is a library that allow you to interact with a Luxtronik heatpump controller.
MIT License
37 stars 19 forks source link

Fix test #151

Closed gerw closed 6 months ago

gerw commented 6 months ago

Fixes #150

gerw commented 6 months ago

Am I being crazy? Why does pytest fails exactly at the line which I have changed? Does it test the previous version of the code?

Bouni commented 6 months ago

🤔 Can you try to rebase onto main? Maybe something went wrong there !?

gerw commented 6 months ago

I think there is nothing to rebase here. This PR is directly one commit below main, isn't it?

Bouni commented 6 months ago

I've just checked, your branch is up to date with the upstream main branch except the single line change.

But I think I found the issue, the CI job does a check out of the main branch, not your PR branch fix150:

https://github.com/Bouni/python-luxtronik/actions/runs/7785513708/job/21228279923?pr=151#step:2:51

Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +3d94a5903fe1e104531bd481e4277dfc11668f1a:refs/remotes/origin/main
gerw commented 6 months ago

Now, the publishing of the code coverage seems to fail. I think we already had this issue at some time in the past?

Bouni commented 6 months ago

I'll look into it tomorrow

Bouni commented 6 months ago

Guess I found a solution:

https://github.com/MishaKav/pytest-coverage-comment/issues/68#issuecomment-1229144760

Will add the permissions tomorrow

Bouni commented 6 months ago

Ok, Chat GPT sucks as it proposed wrong inputs for the coverage action 🤦🏽‍♂️ I simply don't understand why it works if I do a PR but not for you ...

Maybe because I'm the owner of the repo and you just a contributer!?

I'll try to find another solution ...

gerw commented 6 months ago

No, I think that the problem is that your PRs come directly from this repo, but my PR come from a different repo. In principle, everybody could file a PR with (potentially malicious) code and this should not be executed with the permissions of this repo.

gerw commented 6 months ago

What happens if you change repo-token to github-token?

Bouni commented 6 months ago

I don't know, lets try.

Bouni commented 6 months ago

I just changed the actions settings in the hope that it fixes the problem, can you do git commit --allow-empty -m "Trigger-CI" to see if that works?

gerw commented 6 months ago

Now, the workflows seem to fail already at startup...

Bouni commented 6 months ago

Ok then I'll put the settings back to original and continue to search for a solution

Bouni commented 6 months ago

I guess I found the answer in this blog post

https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

I'll try to create a two staged coverage ci workflow tomorrow

Bouni commented 6 months ago

@gerw Now everything runs but MishaKav/pytest-coverage-comment@main gives this error:

Warning: This action supports comments only on `pull_request`, `pull_request_target`, `push` and `workflow_dispatch`  events. `workflow_run` events are not supported.

So still no coverage report for forked repo PRs but at least the pytest CI workflow works.

I'll see if I can fix this somehow. Anyway, now we can continue with the real work on python-luxtronik 🥳