Skip to content

Fix CI #77

@abhiabhi94

Description

@abhiabhi94

@claude can you look at this CI run: https://github.com/abhiabhi94/job-board/actions/runs/21093023213/job/60666839566 and fix it. The CI was working earlier.

Specifically this traceback for the failure is

____________________________ test_get_jobs_sorting _____________________________

db_session = <sqlalchemy.orm.session.Session object at 0x7f5983158d70>
client = <FlaskClient <Flask 'job_board.views'>>
captured_templates = [TemplateContent(template=<Template 'jobs/index.html'>, context={'jobs': [Job(id=77, title='Job 2', description='Anoth...e240fb645041dca4ab3050a54e22f5961cfcf2d9,sentry-transaction=get_jobs,sentry-sample_rate=0.1,sentry-sampled=false">')})]

    def test_get_jobs_sorting(db_session, client, captured_templates):
        response = client.get("/", query_string={"sort": "blah"})
        assert response.status_code == 400
    
        link_1 = "https://example.com/job1"
        link_2 = "https://example.com/job2"
        job_1 = JobListing(
            link=link_1,
            title="Job 1",
            min_salary=30_000,
            is_remote=True,
            tags=["python", "remote"],
            description="A job description",
            payload="some data",
            company_name="Test Company",
        )
        job_2 = JobListing(
            link=link_2,
            title="Job 2",
            min_salary=25_000,
            is_remote=True,
            description="Another job description",
            tags=["python"],
            payload="some data",
            company_name="Test Company",
        )
    
        store_jobs([job_1, job_2])
    
        response = client.get(
            "/",
            query_string={
                "sort": "salary_desc",
            },
        )
    
        assert response.status_code == 200
        context = captured_templates[-1].context
>       assert [j.link for j in context["jobs"]] == [link_1, link_2]
E       AssertionError: assert ['https://exa...ple.com/job1'] == ['https://exa...ple.com/job2']
E         
E         At index 0 diff: 'https://example.com/job2' != 'https://example.com/job1'
E         
E         Full diff:
E           [
E         +     'https://example.com/job2',
E               'https://example.com/job1',
E         -     'https://example.com/job2',
E           ]

tests/test_views.py:248: AssertionError
----------------------------- Captured stderr call -----------------------------
+0000 17/01/2026 10:45:51 AM - job-board - INFO - Stored 2 new jobs
+0000 17/01/2026 10:45:51 AM - job-board - INFO - Stored tags for 2 jobs
+0000 17/01/2026 10:45:51 AM - job-board - INFO - Stored 2 new payloads
------------------------------ Captured log call -------------------------------
INFO     job-board:models.py:289 Stored 2 new jobs
INFO     job-board:models.py:362 Stored tags for 2 jobs
INFO     job-board:models.py:395 Stored 2 new payloads
=============================== warnings summary ===============================
tests/test_models.py::test_location_check_constraint
  /home/runner/work/job-board/job-board/tests/conftest.py:62: SAWarning: transaction already deassociated from connection
    transaction.rollback()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_views.py::test_get_jobs_sorting - AssertionError: assert ['https://exa...ple.com/job1'] == ['https://exa...ple.com/job2']
  
  At index 0 diff: 'https://example.com/job2' != 'https://example.com/job1'
  
  Full diff:
    [
  +     'https://example.com/job2',
        'https://example.com/job1',
  -     'https://example.com/job2',
    ]
================== 1 failed, 120 passed, 1 warning in 31.41s ===================
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions