Re: Seeking help in getting run-tox-ceph-detect-init to work.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 9, 2016 at 6:57 AM, Willem Jan Withagen <wjw@xxxxxxxxxxx> wrote:
> Hi,
>
> I'm looking for a developer with more Python experience....
> Especially with getting things thru tox.
>
> I was able to add FreeBSD support to ceph-detect-init in #11829. But
> then that is tested in run-tox-detect-init. Which now fails in a Linux
> Jenkins run:
> https://jenkins.ceph.com/job/ceph-pull-requests/13621/consoleFull#124607955c19247c4-fcb7-4c61-9a5d-7e2b9731c678
>
> But that heavily depends on mock and variations on
> platform.linux_distribution(), which is over my head.
>
> Like:
>     def test_get(self):
>         g = ceph_detect_init.get
>        with mock.patch('platform.linux_distribution',
>                         lambda **kwargs: (('unknown', '', ''))):
>             self.assertRaises(exc.UnsupportedPlatform, g)
>
> Which hits the assert because linux_distribution() returns
>         (' ', ' ', ' ')
> and the system info needs to be extracted from other functions.
>
> The brutal way would be to override this test, but the question then is
> with what? Because there is no one function that returns the required
> values. So the code would be a copy from what is in the _init_.py code.
>
> And that feels like a butcher testing his own meat.

yes, you need to mock some methods get called in
platform_information(), please see the updated patch at:
https://github.com/tchaikov/ceph/commit/fced2823c311bee2be0d226759809fc10170a6ff

in which, i also added a test for unsupported system.

>
> So help very much welcomed,
> --WjW
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Regards
Kefu Chai
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux