Esempio n. 1
0
    def configure(self, parser):
        run_subcommand_parser = parser.subcommands.choices.get('run', None)
        if run_subcommand_parser is None:
            return

        self.parser = parser
        run_subcommand_parser.output.add_argument(
            '--xunit',
            type=str,
            action=FileOrStdoutAction,
            dest='xunit_output',
            metavar='FILE',
            help=('Enable xUnit result format and write it to FILE. '
                  "Use '-' to redirect to the standard output."))

        run_subcommand_parser.output.add_argument(
            '--xunit-job-result',
            dest='xunit_job_result',
            choices=('on', 'off'),
            default='on',
            help=('Enables default xUnit result in the job results directory. '
                  'File will be named "results.xml".'))

        run_subcommand_parser.output.add_argument(
            '--xunit-max-test-log-chars',
            metavar='SIZE',
            type=lambda x: data_structures.DataSize(x).b,
            help="Limit the "
            "attached job log to given number of characters (k/m/g suffix "
            "allowed)")
Esempio n. 2
0
    def configure(self, parser):
        run_subcommand_parser = parser.subcommands.choices.get('run', None)
        if run_subcommand_parser is None:
            return

        self.parser = parser
        run_subcommand_parser.output.add_argument(
            '--xunit',
            type=str,
            action=FileOrStdoutAction,
            dest='xunit_output',
            metavar='FILE',
            help=('Enable xUnit result format and write it to FILE. '
                  "Use '-' to redirect to the standard output."))

        run_subcommand_parser.output.add_argument(
            '--xunit-job-result',
            dest='xunit_job_result',
            choices=('on', 'off'),
            default='on',
            help=('Enables default xUnit result in the job results directory. '
                  'File will be named "results.xml". '
                  'Defaults to on.'))

        run_subcommand_parser.output.add_argument(
            '--xunit-job-name',
            default=None,
            help="Override the reported "
            "job name. By default uses the Avocado job name which is always "
            "unique. This is useful for reporting in Jenkins as it only "
            "evaluates first-failure from jobs of the same name.")

        run_subcommand_parser.output.add_argument(
            '--xunit-max-test-log-chars',
            metavar='SIZE',
            type=lambda x: data_structures.DataSize(x).b,
            help="Limit the "
            "attached job log to given number of characters (k/m/g suffix "
            "allowed)")
Esempio n. 3
0
 def test_valid(self):
     data_structures.DataSize('0')
     data_structures.DataSize('0t')
     data_structures.DataSize('10')
Esempio n. 4
0
 def test_values(self):
     self.assertEqual(data_structures.DataSize('10m').b, 10485760)
     self.assertEqual(data_structures.DataSize('10M').b, 10485760)
Esempio n. 5
0
 def test_value_and_type(self):
     self.assertIs(data_structures.DataSize('0b').b, 0)
     self.assertIs(data_structures.DataSize('0t').b, 0)
Esempio n. 6
0
 def test_value_and_type(self):
     self.assertEqual(data_structures.DataSize("0b").b, 0)
     self.assertEqual(data_structures.DataSize("0t").b, 0)
Esempio n. 7
0
 def test_valid(self):
     data_structures.DataSize("0")
     data_structures.DataSize("0t")
     data_structures.DataSize("10")