Skip to content

Commit

Permalink
Timeout and print times for test_with_fft_and_pythran
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 31, 2024
1 parent 31e6755 commit ce03130
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ test_without_fft_and_pythran:

test_with_fft_and_pythran:
stage: test
timeout: 2 hours
needs:
- job: "image:build"
optional: true
Expand Down
25 changes: 25 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import os
from datetime import timedelta
from pathlib import Path
from shutil import rmtree
from time import time

import nox

Expand Down Expand Up @@ -48,19 +50,42 @@ def _install_fluidfft(session):
)


time_last = 0


@nox.session
def test_with_fft_and_pythran(session):
global time_last
time_start = time_last = time()

def print_times(task: str):
global time_last
time_now = time()
if time_start != time_last:
print(f"Time for {task}: {timedelta(seconds=time_now - time_last)}")
print(f"Session started since {timedelta(seconds=time_now - time_start)}")
time_last = time_now

_install_fluidfft(session)

print_times("installing fluidfft")

command = "pdm sync --clean -G dev -G test -G fft -G mpi --no-self"
session.run_always(*command.split(), external=True)

print_times("pdm sync")

command = ". -v --no-deps -C setup-args=-Dnative=true"
if "GITLAB_CI" in os.environ:
command += " -C compile-args=-j2"
session.install(*command.split())

print_times("installing fluidsim")

_test(session)

print_times("tests")


@nox.session
def doc(session):
Expand Down

0 comments on commit ce03130

Please sign in to comment.