Skip to content

Commit

Permalink
Merge pull request #285 from pyiron/flux_integration_test
Browse files Browse the repository at this point in the history
Add flux integration test
  • Loading branch information
jan-janssen committed Apr 24, 2024
2 parents 46197f9 + 3e54b36 commit e84fbd6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup environment
run: |
cp .ci_support/environment.yml environment.yml
echo "- flux-core" >> environment.yml
echo "- flux-core =0.59.0" >> environment.yml
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -32,12 +32,18 @@ jobs:
activate-environment: my-env
environment-file: environment.yml
use-mamba: true
- name: Test
- name: Install
shell: bash -l {0}
run: |
pip install versioneer[toml]==0.29
pip install . --no-deps --no-build-isolation
- name: Test
shell: bash -l {0}
run: >
flux start
coverage run --omit="pysqa/_version.py,tests/*" -m unittest discover tests
coverage xml
- name: Collect Coverage
shell: bash -l {0}
run: coverage xml
- name: Coveralls
uses: coverallsapp/github-action@v2
1 change: 1 addition & 0 deletions pysqa/wrapper/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ def convert_queue_status(queue_status_output: str) -> pandas.DataFrame:
)
df.loc[df.status == "R", "status"] = "running"
df.loc[df.status == "S", "status"] = "pending"
df.loc[df.status == "C", "status"] = "error"
df.loc[df.status == "CD", "status"] = "finished"
return df
14 changes: 14 additions & 0 deletions tests/test_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Copyright (c) Jan Janssen

import os
from time import sleep
import unittest

import pandas
from pysqa import QueueAdapter

Expand Down Expand Up @@ -92,3 +94,15 @@ def execute_command(
echo hello"""
self.assertEqual(content, output)
os.remove("run_queue.sh")

def test_flux_integration(self):
job_id = self.flux.submit_job(
queue="flux",
job_name="test",
working_directory=".",
cores=1,
command="sleep 1"
)
self.assertEqual(self.flux.get_status_of_job(process_id=job_id), 'running')
self.flux.delete_job(process_id=job_id)
self.assertEqual(self.flux.get_status_of_job(process_id=job_id), 'error')

0 comments on commit e84fbd6

Please sign in to comment.