Skip to content

Commit

Permalink
Fix failing unittests. (#4018)
Browse files Browse the repository at this point in the history
Including one caused by a nonhermetic test relying on environment
variables set outside of the test.
  • Loading branch information
jonathanmetzman authored Jun 6, 2024
1 parent 7f39a19 commit 5d4bd65
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

from clusterfuzz._internal.base import errors
from clusterfuzz._internal.base import utils
# Add this so some badly written code doesn't cause a test failure.
# TODO(https://github.com/google/clusterfuzz/issues/4016): Fix this.
from clusterfuzz._internal.bot.tasks.utasks import \
fuzz_task # pylint: disable=unused-import
from clusterfuzz._internal.build_management import build_manager
from clusterfuzz._internal.datastore import data_types
from clusterfuzz._internal.system import environment
Expand Down Expand Up @@ -1639,7 +1643,7 @@ def test_setup_fuzz(self):
'/revisions',
fuzz_target=None,
trusted=True)
self.assertCountEqual(build.fuzz_targets, [])
self.assertCountEqual(build.fuzz_targets, ['target1', 'target2', 'target3'])

def test_setup_nonfuzz(self):
"""Tests setting up a build during a non-fuzz task."""
Expand Down Expand Up @@ -1668,7 +1672,7 @@ def test_setup_nonfuzz(self):
'/revisions',
fuzz_target=None,
trusted=True)
self.assertEqual(build.fuzz_targets, [])
self.assertEqual(build.fuzz_targets, ['target1', 'target2', 'target3'])

def test_delete(self):
"""Test deleting this build."""
Expand Down

0 comments on commit 5d4bd65

Please sign in to comment.