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

threadsafe death tests, update Ubuntu and g++ in CI #509

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
48 changes: 24 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,43 @@ env:
jobs:

Linux:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
matrix:
alphabet: [DNA, Protein]
build_type: [Debug, Release]
compiler: [g++-8, g++-9, g++-10, g++-11]
compiler: [g++-11, g++-12, g++-13]
build_static: [OFF, ON]
with_avx: [OFF, ON]
include:
- compiler: g++-8
cxx: g++-8
cc: gcc-8

- compiler: g++-9
cxx: g++-9
cc: gcc-9

- compiler: g++-10
cxx: g++-10
cc: gcc-10

- compiler: g++-11
cxx: g++-11
cc: gcc-11

- compiler: g++-12
cxx: g++-12
cc: gcc-12

- compiler: g++-13
cxx: g++-13
cc: gcc-13

exclude:
- alphabet: Protein
compiler: g++-9
- compiler: g++-8
build_static: ON
- compiler: g++-9
compiler: g++-11
- alphabet: Protein
compiler: g++-12
- compiler: g++-11
build_static: ON
- compiler: g++-10
- compiler: g++-12
build_static: ON
- build_type: Debug
build_static: ON
- build_type: Debug
compiler: g++-11
- build_type: Debug
compiler: g++-12
- with_avx: OFF
build_static: OFF

Expand Down Expand Up @@ -119,7 +119,7 @@ jobs:
if: matrix.with_avx == 'OFF'
run: mv metagraph/build/metagraph_${{ matrix.alphabet }} metagraph/build/metagraph_${{ matrix.alphabet }}_noAVX
- name: upload static binary
if: ${{ matrix.build_static == 'ON' && matrix.compiler == 'g++-11' }}
if: ${{ matrix.build_static == 'ON' && matrix.compiler == 'g++-13' }}
uses: actions/upload-artifact@v4
with:
name: metagraph_${{ matrix.alphabet }}${{ matrix.with_avx == 'OFF' && '_noAVX' || '' }}_linux_x86
Expand Down Expand Up @@ -194,16 +194,16 @@ jobs:

Metagraph-Workflows:
name: Test metagraph workflows
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [Linux]

steps:
- uses: actions/checkout@v2

- name: Set up Python 3.8
- name: Set up Python 3.12
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12

- name: fetch static binary
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
# adapted from https://docs.github.com/en/actions/guides/publishing-docker-images#publishing-images-to-github-packages
if: github.event_name != 'pull_request'
needs: [Linux, Metagraph-Workflows]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
Expand Down
11 changes: 11 additions & 0 deletions metagraph/tests/test_all.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include "gtest/gtest.h"

int main(int argc, char** argv) {
testing::InitGoogleTest(&argc, argv);

#ifndef NDEBUG
GTEST_FLAG_SET(death_test_style, "threadsafe");
#endif

return RUN_ALL_TESTS();
}
2 changes: 2 additions & 0 deletions metagraph/tests/test_bit_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ TYPED_TEST(BitVectorTest, Serialization) {
}
}

/* TODO: re-enable this later
TYPED_TEST(BitVectorTest, LoadWithMMAP) {
std::vector<std::initializer_list<bool>> init_lists = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
Expand Down Expand Up @@ -476,6 +477,7 @@ TYPED_TEST(BitVectorTest, LoadWithMMAP) {
reference_based_test(*vector, numbers);
}
}
*/

TEST(bit_vector_sd, SerializationCatchErrorWhenLoadingSdVector) {
std::vector<std::initializer_list<bool>> init_lists = {
Expand Down
6 changes: 4 additions & 2 deletions metagraph/workflows/metagraph_workflows/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from typing import Iterable, Optional, Dict, Any

import snakemake
import snakemake.io
import snakemake.utils

from .workflow_configs import SEQS_FILE_LIST_PATH, SEQS_DIR_PATH, \
AnnotationLabelsSource, AnnotationFormats
Expand Down Expand Up @@ -41,7 +43,7 @@ def run_build_workflow(

snakefile_path = Path(WORKFLOW_ROOT / 'Snakefile')

config = snakemake.load_configfile(default_path)
config = snakemake.io.load_configfile(default_path)

if not seqs_file_list_path and not seqs_dir_path:
raise ValueError("seqs_file_list_path and seqs_dir_path cannot both be None")
Expand All @@ -65,7 +67,7 @@ def run_build_workflow(
annotation_formats] if annotation_formats else config['annotation_formats']

config['metagraph_cmd'] = metagraph_cmd if metagraph_cmd else config['metagraph_cmd']
config['max_threads'] = threads if threads else snakemake.available_cpu_count()
config['max_threads'] = threads if threads else snakemake.utils.available_cpu_count()

if verbose:
importlib.reload(logging)
Expand Down
Loading