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

Fix test dir usage in test_wandb #642

Merged
merged 3 commits into from
Aug 15, 2023
Merged
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
4 changes: 2 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: continuumio/miniconda3:latest
image: condaforge/mambaforge:latest

stages:
- test
Expand All @@ -11,7 +11,7 @@ variables:
# set up basic job
.runtests:
before_script:
- "conda create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes --quiet"
- "mamba create --prefix /root/rsmenv -c conda-forge -c ets --file requirements.txt python=${PYVERSION} --yes"
- /root/rsmenv/bin/pip install -e .
- echo "import os" > sitecustomize.py
- echo "try:" >> sitecustomize.py
Expand Down
1 change: 1 addition & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fix = true
select = ["D", "E", "F", "I"]
ignore = ["D212"]
line-length = 100
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
coverage
codecov
doc2dash
ipython
Expand All @@ -8,7 +7,6 @@ notebook
numpy
openpyxl
pandas
parameterized
pre-commit
seaborn
shap==0.42.1
Expand Down
10 changes: 9 additions & 1 deletion tests/test_wandb.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
import os
import unittest
from os.path import join
from unittest.mock import Mock, patch

import pandas as pd

from rsmtool.configuration_parser import Configuration
from rsmtool.test_utils import rsmtool_test_dir
from rsmtool.utils.wandb import (
init_wandb_run,
log_configuration_to_wandb,
log_dataframe_to_wandb,
log_report_to_wandb,
)

# allow test directory to be set via an environment variable
# which is needed for package testing
TEST_DIR = os.environ.get("TESTDIR", None)
if TEST_DIR:
rsmtool_test_dir = TEST_DIR
else:
from rsmtool.test_utils import rsmtool_test_dir


class TestWandb(unittest.TestCase):
def test_init_wandb_run_wandb_enabled(self):
Expand Down