From 1a128266fd144eada9d8e74724402c6e0e84267d Mon Sep 17 00:00:00 2001 From: Joel Oskarsson Date: Fri, 6 Dec 2024 16:04:49 +0100 Subject: [PATCH] Change wandb env var to properly disable at start of testing (#94) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Describe your changes Tests are not working properly as wandb without any user logged in are making them crash. This should not happen, since we disable WANDB with env var when running the tests, but that variable is wrong. This is an attempt to fix that, to make sure wandb is disabled when running tests. ## Issue Link None ## Type of change - [x] 🐛 Bug fix (non-breaking change that fixes an issue) - [ ] ✨ New feature (non-breaking change that adds functionality) - [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 📖 Documentation (Addition or improvements to documentation) ## Checklist before requesting a review - [x] My branch is up-to-date with the target branch - if not update your fork with the changes from the target branch (use `pull` with `--rebase` option if possible). - [ ] I have performed a self-review of my code - [ ] For any new/modified functions/classes I have added docstrings that clearly describe its purpose, expected inputs and returned values - [ ] I have placed in-line comments to clarify the intent of any hard-to-understand passages of my code - [ ] I have updated the [README](README.MD) to cover introduced code changes - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have given the PR a name that clearly describes the change, written in imperative form ([context](https://www.gitkraken.com/learn/git/best-practices/git-commit-message#using-imperative-verb-form)). - [x] I have requested a reviewer and an assignee (assignee is responsible for merging). This applies only if you have write access to the repo, otherwise feel free to tag a maintainer to add a reviewer and assignee. ## Checklist for reviewers Each PR comes with its own improvements and flaws. The reviewer should check the following: - [ ] the code is readable - [ ] the code is well tested - [ ] the code is documented (including return types and parameters) - [ ] the code is easy to maintain ## Author checklist after completed review - [x] I have added a line to the CHANGELOG describing this change, in a section reflecting type of change (add section where missing): - *added*: when you have added new functionality - *changed*: when default behaviour of the code has been changed - *fixes*: when your contribution fixes a bug ## Checklist for assignee - [x] PR is up to date with the base branch - [x] the tests pass - [x] author has added an entry to the changelog (and designated the change as *added*, *changed* or *fixed*) - Once the PR is ready to be merged, squash commits and merge the PR. --- CHANGELOG.md | 2 ++ tests/conftest.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01d4cac..32961b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fix wandb environment variable disabling wandb during tests. Now correctly uses WANDB_MODE=disabled. [\#94](https://github.com/mllam/neural-lam/pull/94) @joeloskarsson + - Fix bugs introduced with datastores functionality relating visualation plots [\#91](https://github.com/mllam/neural-lam/pull/91) @leifdenby ## [v0.2.0](https://github.com/joeloskarsson/neural-lam/releases/tag/v0.2.0) diff --git a/tests/conftest.py b/tests/conftest.py index 6f57962..5d799c7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -17,7 +17,7 @@ # Disable weights and biases to avoid unnecessary logging # and to avoid having to deal with authentication -os.environ["WANDB_DISABLED"] = "true" +os.environ["WANDB_MODE"] = "disabled" DATASTORE_EXAMPLES_ROOT_PATH = Path("tests/datastore_examples")