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

GitHub Actions fail when attempting to locate external files #78

Closed
stratofax opened this issue Aug 22, 2022 · 0 comments · Fixed by #98
Closed

GitHub Actions fail when attempting to locate external files #78

stratofax opened this issue Aug 22, 2022 · 0 comments · Fixed by #98
Assignees
Labels
bug Something isn't working

Comments

@stratofax
Copy link
Collaborator

The ballot generation process requires that the program access external files, like PNG files. Although this process works on my Mac and Linux machines, these tests fail when running in GitHub Actions.

Error output:

Run poetry run pytest
============================= test session starts ==============================
platform linux -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/runner/work/BallotLabFork/BallotLabFork
plugins: cov-3.0.0
collected 12 items

tests/test_cli.py ......                                                 [ 50%]
tests/test_demo.py F                                                     [ 58%]
tests/test_election_data.py ...                                          [ 83%]
tests/test_make_ballots.py .                                             [ 91%]
tests/test_validate_edf.py .                                             [100%]

=================================== FAILURES ===================================
__________________________________ test_demo ___________________________________

    def test_demo():
>       assert make_demo_ballot() == NO_ERRORS

tests/test_demo.py:6: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/electos/ballotmaker/demo.py:11: in make_demo_ballot
    build_ballot()
src/electos/ballotmaker/ballots/demo_ballot.py:126: in build_ballot
    inst = Instructions()
src/electos/ballotmaker/ballots/instructions.py:182: in __init__
    build_instruction_list()
src/electos/ballotmaker/ballots/instructions.py:63: in build_instruction_list
    image1 = EmbeddedImage("filled_bubble.png", image_width)
src/electos/ballotmaker/ballots/images.py:25: in __init__
    self.file_check(image_file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <electos.ballotmaker.ballots.images.EmbeddedImage object at 0x7f44afb06610>
image_file = <electos.ballotmaker.ballots.files.FileTools object at 0x7f44afb06b20>

    def file_check(self, image_file):
        if image_file.file_found is False:
            file_error = "File {} not found in {}".format(
                self.image_name, self.rel_img_path
            )
>           raise FileNotFoundError(file_error)
E           FileNotFoundError: File filled_bubble.png not found in assets/img

src/electos/ballotmaker/ballots/images.py:50: FileNotFoundError
=========================== short test summary info ============================
FAILED tests/test_demo.py::test_demo - FileNotFoundError: File filled_bubble....
========================= 1 failed, 11 passed in 0.44s =========================
Error: Process completed with exit code 1.
@stratofax stratofax added the bug Something isn't working label Aug 22, 2022
@stratofax stratofax self-assigned this Aug 22, 2022
@stratofax stratofax linked a pull request Aug 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant