opencompute-developers team mailing list archive
-
opencompute-developers team
-
Mailing list archive
-
Message #00037
[Merge] lp:~jeffmarcom/opencompute/unit_test_cleanup into lp:opencompute/checkbox
Jeff Marcom has proposed merging lp:~jeffmarcom/opencompute/unit_test_cleanup into lp:opencompute/checkbox.
Commit message:
Removed gpu_benchmark_test test script
Requested reviews:
Open Compute Developers (opencompute-developers)
For more details, see:
https://code.launchpad.net/~jeffmarcom/opencompute/unit_test_cleanup/+merge/180957
This removes the gpu_benchmark_test test script from ocp-checkbox so that we can continue to use the unittest feature without error.
--
https://code.launchpad.net/~jeffmarcom/opencompute/unit_test_cleanup/+merge/180957
Your team Open Compute Developers is requested to review the proposed merge of lp:~jeffmarcom/opencompute/unit_test_cleanup into lp:opencompute/checkbox.
=== removed file 'test_scripts/tests/test_gputest_benchmark.py'
--- test_scripts/tests/test_gputest_benchmark.py 2013-04-16 08:09:40 +0000
+++ test_scripts/tests/test_gputest_benchmark.py 1970-01-01 00:00:00 +0000
@@ -1,82 +0,0 @@
-#
-# This file is part of Checkbox.
-#
-# Copyright 2013 Canonical Ltd.
-#
-# Checkbox is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Checkbox is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Checkbox. If not, see <http://www.gnu.org/licenses/>.
-#
-import imp
-import os
-import unittest
-
-from mock import patch
-from tempfile import NamedTemporaryFile
-
-imp.load_source('gputest_benchmark', os.path.join(os.path.dirname(__file__),
- '..', '..', 'scripts', 'gputest_benchmark'))
-from gputest_benchmark import check_log
-
-
-class LogParserTest(unittest.TestCase):
-
- def setUp(self):
- self.logfile = NamedTemporaryFile(delete=False)
- self.devnull = open(os.devnull, 'w')
-
- def test_logfile_not_found(self):
- os.unlink(self.logfile.name)
- with self.assertRaises(SystemExit) as cm:
- check_log(self.logfile.name)
- self.assertEqual(
- "[Errno 2] No such file or directory: "
- "'{}'".format(self.logfile.name),
- str(cm.exception))
-
- def test_logfile_with_score(self):
- with open(self.logfile.name, 'wt') as f:
- f.write('FurMark : init OK.\n')
- f.write('[Benchmark_Score] - module: FurMark - Score: 8 points'
- '(800x600 windowed, duration:2000 ms).')
- with patch('sys.stdout', self.devnull):
- self.assertFalse(check_log(self.logfile.name))
- os.unlink(self.logfile.name)
-
- def test_logfile_without_score(self):
- with open(self.logfile.name, 'wt') as f:
- f.write('FurMark : init OK.\n')
- f.write('[No_Score] - module: FurMark - Score: _ points'
- '(800x600 windowed, duration:2000 ms).')
- with patch('sys.stdout', self.devnull):
- with self.assertRaises(SystemExit) as cm:
- check_log(self.logfile.name)
- self.assertEqual(
- 'Benchmark score not found, check the log for errors',
- str(cm.exception))
- os.unlink(self.logfile.name)
-
- def test_logfile_with_encoding_error(self):
- with open(self.logfile.name, 'wb') as f:
- f.write(b'\x80abc\n')
- f.write(b'FurMark : init OK.\n')
- f.write(b'[Benchmark_Score] - module: FurMark - Score: 116 points'
- b'(800x600 windowed, duration:2000 ms).')
- with patch('sys.stdout', self.devnull):
- self.assertFalse(check_log(self.logfile.name))
- os.unlink(self.logfile.name)
-
- def tearDown(self):
- try:
- os.unlink(self.logfile.name)
- except OSError:
- pass
References