Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-20.04"]
python: [3.6, 3.9, 3.11]
python: [3.9, 3.11, 3.13]
Copy link
Contributor

@kshtsk kshtsk Apr 3, 2025

Choose a reason for hiding this comment

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

I think jammy (ubuntu 24) still has 3.10 by default.

steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand Down
10 changes: 2 additions & 8 deletions paddles/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ def setup_class(cls):
pmodels.commit()
pmodels.clear()

@classmethod
def teardown_class(cls):
pmodels.rollback()
pmodels.clear()

def setup(self):
def setup_method(self):
config = deepcopy(self.config)

# Add the appropriate connection string to the app config.
Expand All @@ -60,8 +55,7 @@ def setup(self):
def load_test_app(self, config):
return load_test_app(config)

def teardown(self):
# Tear down and dispose the DB binding
def teardown_method(self):
pmodels.rollback()
pmodels.clear()

Expand Down
2 changes: 1 addition & 1 deletion paddles/tests/controllers/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_manual_updated_time(self):
self.app.post_json('/runs/%s/jobs/' % run_name, dict(
updated=time_stamp,
))
local_dt = datetime.strptime(time_stamp, '%Y-%m-%d %H:%M:%S')
local_dt = datetime.fromisoformat(time_stamp)
utc_dt = local_datetime_to_utc(local_dt)
response = self.app.get('/runs/%s/jobs/%s/' % (run_name, 1))
assert response.json['updated'] == str(utc_dt)
Expand Down
8 changes: 6 additions & 2 deletions paddles/tests/controllers/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,19 @@ def test_queue_stats(self):

def test_pause_queue(self):
self.app.post_json('/queue/', dict(queue="test_queue3"))
pause_duration = 0.05
response = self.app.put_json('/queue/', dict(
queue="test_queue3",
paused_by="tester",
pause_duration=10,
pause_duration=pause_duration,
))
assert response.status_code == 200
response = self.app.get('/queue/?machine_type=test_queue3')
assert response.json[0]['paused'] is True
time.sleep(10)
time.sleep(pause_duration / 2)
response = self.app.get('/queue/?machine_type=test_queue3')
assert response.json[0]['paused'] is True
time.sleep(pause_duration / 2)
response = self.app.get('/queue/?machine_type=test_queue3')
assert response.json[0]['paused'] is False

Expand Down
6 changes: 3 additions & 3 deletions paddles/tests/controllers/test_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class TestRunController(TestApp):
def teardown_method(self, meth):
def teardown_method(self):
start()
Job.query.delete()
Run.query.delete()
Expand Down Expand Up @@ -225,8 +225,8 @@ def test_queued_partially(self):

class TestRunControllerDateFilters(TestApp):

def setup(self):
TestApp.setup(self)
def setup_method(self):
super().setup_method()
self.day1_runs = [
'teuthology-2013-01-01_00:00:00-rados-next-testing-basic-plana',
'teuthology-2013-01-01_00:00:01-nfs-next-testing-basic-plana',
Expand Down
2 changes: 1 addition & 1 deletion paddles/tests/models/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_force_updated_time(self):
time_stamp = '2014-03-31 21:25:43'
Job(dict(job_id=11, id=11, updated=time_stamp), run)
models.commit()
local_dt = datetime.strptime(time_stamp, '%Y-%m-%d %H:%M:%S')
local_dt = datetime.fromisoformat(time_stamp)
utc_dt = local_datetime_to_utc(local_dt)
job = Run.query.filter(Run.name == run.name).one().jobs[0]
assert str(job.updated) == str(utc_dt)
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ alembic==1.7.7
pecan==1.3.3
psycopg2-binary==2.9.5
pytz==2023.3
requests==2.20.0
requests==2.32.3
SQLAlchemy==1.3.0
tzlocal==1.2
WebTest==3.0.0
gunicorn==20.0.4
python-statsd==2.0.0
mock==2.0.0
pytest==6.2.4
pytest==8.3.5
sentry-sdk==1.3.1