17:04:05 #startmeeting Testing Working Group 17:04:06 Meeting started Thu Aug 31 17:04:05 2017 UTC. The chair is gundalow. Information about MeetBot at http://wiki.debian.org/MeetBot. 17:04:06 Useful Commands: #action #agreed #halp #info #idea #link #topic. 17:04:06 The meeting name has been set to 'testing_working_group' 17:04:18 #chair mattclay jtanner sivel Pilou 17:04:18 Current chairs: Pilou gundalow jtanner mattclay sivel 17:04:26 #info Agenda https://github.com/ansible/community/issues/114 17:04:31 #topic What should qualify as a destructive test? 17:04:33 Generally speaking, a "destructive" test to me, is any thing that makes a change to my system, outside of creating and manipulating temporary files in a temp working dir 17:04:40 #info https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/dev_guide/testing_integration.rst#destructive-tests 17:04:49 #info Though we may want to change this based on https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/dev_guide/testing_integration.rst#destructive-tests 17:04:57 sivel: That is basically what we have defined currently in documentation. 17:05:20 Is installing a package a destructive action? 17:05:27 by the way, what is a "trivial package" ? 17:05:29 destructive == don't run this on your primary laptop 17:05:40 yes, as it could be updating a package to a version I don't want 17:05:53 and if the tests remove it later, it could be removing a package I need installed 17:05:57 sivel: Is there a difference between installing vs upgrading? 17:06:09 an os package can be very destructive 17:06:27 mattclay: many package managers don't make that distinction, if you tell it to install, it will often upgrade an already installed package 17:06:30 specially something like java.rpm 17:06:34 depending on if we specify 'state: latest' 17:06:46 or it could conflict with an already installed package 17:07:03 sivel: Yeah, latest would definitely qualify as destructive. I was wondering if `state: present` should as well. 17:07:04 as bcoca mentions, openjdk vs javajdk 17:07:16 mattclay: yes, it could, in the example I jsut gave 17:07:26 upgrading may also upgrade dependecies 17:07:28 present implies install 17:08:17 effectively, I think *any* change it makes to a system, other than manipulating files in a temporary directory, are "destructive" 17:08:17 That makes this easy then. We should keep the existing documented definition of destructive and update our existing tests to add the alias where it's currently missing. 17:08:44 anything package related that can 'writes' is probably destructive, include 'state:present' 17:08:45 if it changes the system, it's destructive 17:09:02 should not "trivial" be removed from the current definition ? 17:09:22 "trivial" = doesn't mean anything 17:09:33 Pilou: Yeah, we should remove "trivial" 17:10:05 * gundalow thinks any usage of package manager = distructive 17:10:40 We can probably automate a test for that to require the `destructive` alias on tests which use package managers. 17:10:42 Honestly, I might add more to that: These tests may make changes to your system, such as installing or removing packages, creating users, or deleting important files... 17:11:20 Like tests for the timezone module I would consider destructive 17:11:24 tests for the hostname module 17:11:41 Although we could probably extend that to a list of modules which, if used in a test, would require it to be marked destructive. 17:11:43 sysctl... 17:11:52 but you all get the point 17:12:32 any target that has "needs/root" and is doing more that changing permissions on a file is destructive 17:12:57 also depends on changing perms to what file 17:13:06 a file in my /etc/ dir, probably destructive 17:13:06 sivel: Good point :) 17:13:08 chmod 777 /etc/shadow 17:13:18 I wouldn't call changing permissions on files private to the test destructive. 17:13:31 so basically anything that happens outside of a sandbox like in a tempdir, is destructive 17:13:37 well, /etc/shadow is not 'private to the test' 17:13:38 * mattclay nods 17:13:54 sivel: any 'changes' outside sandbox 17:14:06 plenty of stuff 'can happen' outside w/o being destructive 17:14:28 like what? just curious 17:14:43 are there some current tests that we're trying to reclassify? aka, what brought this topic up? 17:14:44 mostly checks/reads 17:14:58 jtanner: some 'non destructive' tests were installing packages 17:15:14 ok, sorry, I wasn't as clear in that last statement, in a previous I mentioned: 17:15:16 I think *any* change it makes to a system, other than manipulating files in a temporary directory, are "destructive" 17:15:22 I used manipulation 17:15:28 jtanner: It was brought up by someone who pointed out that the unarchive test was destructive because it installed packages. 17:15:38 so referring to change and manipulation 17:16:24 the question i have is how do i make that designation now? when i create tests for a module, i don't add that target to the destructive/non playbooks 17:16:28 So any changes made outside files/directories belonging soley to the test should qualify for being marked destructive? 17:16:33 they're just auto-run when the module file changes 17:16:43 mattclay: +1 to that definition 17:16:47 mattclay: +1 17:16:52 * abadger2k not sure he likes that 17:16:56 is there something that should go into the alias file? 17:17:07 abadger2k: what are your concerns? 17:17:11 Lots of tests make sure packages are installed 17:17:11 jtanner: We mark destructive tests with the `destructive` alias. 17:17:22 abadger2k: yes, and they should be considered destructive 17:17:29 (at dentist, could drop off at any time) 17:17:30 abadger2k: That is why I brought this up. We're going to end up with a lot more of our tests being marked destructive. 17:17:36 ok, that's my mistake then for some of the recent tests i wrote ... i failed to add that alias when i was also installing packages 17:17:40 as it could ensure a package is isntalled, that could impact how my system operates 17:17:53 Suvel: but in many cases those packages might already be installed 17:17:59 check_mode: true on pkg tasks 17:18:09 ^ you can ensure package is installed and skip otherwise 17:18:09 Maybe we should have a third category? 17:18:09 it's possible, but we shouldn't make that assumption 17:18:34 I mean I *never* run tests outside of docker, as I am pretty sure most are destructive, that don't say they are 17:18:52 I don't want any manipulation of my system when running non-destructive tests 17:19:00 They could have side effects that we aren't aware of 17:19:07 i use docker/vagrant as well 17:19:20 * abadger2k Back in the chair 17:19:31 someone decides to have a test install networkmanager for purposes of testing the network manager module 17:19:41 that is just an install, but can have adverse affects on a system 17:19:49 you don't like networkmangler? 17:19:53 and in some places, users may already have that installed 17:19:56 lol 17:20:31 i'm +1 on any tests that call a package module to be marked destructive 17:20:32 As much as I don't like having to mark a lot more of our existing tests destructive, I think it's the right thing to do from a safety perspective. 17:20:33 it makes it too difficult to currate, if we allow it sometimes and not others 17:21:03 we should play it safe, and mark them as destructive, based on the definition mattclay gave 17:21:21 Should needs/root imply destructive 17:21:21 it's too hard to know what outcome can happen 17:21:32 I can update the docs to be more clear, add missing aliases, and see about adding a sanity test to catch some obvious cases where a test should be marked destructive and isn't. 17:21:34 and we should swap to needing an opt in "non-destructive" 17:21:46 that would make sense to me 17:21:58 gundalow: You want to make destructive the default? 17:22:15 honestly assuming destructive, is safer :) 17:22:26 I'm fine with that. 17:22:28 it's how I handle it now 17:22:34 mattclay: throwing it out as a suggestion 17:22:41 gundalow: not just 'root' as you can need root to read /dev or gather certain facts 17:22:53 I just assume they are all destructive already 17:23:30 bcoca: sure, say if we ended up with a dmidecode module (that needs root to read /dev) that would get "needs/root" + "non-destructive" 17:23:31 If we're going to make that change, I think I'd like to do it separately though. 17:24:08 would be interesting to see results of a 'strace -f -e open /path/to/the-test-runner' 17:24:35 + -e execve 17:25:29 probably going to loose the important stuff inside the connection plugin though 17:27:16 Other than abadger2k, are there any objections to using "any changes made outside files/directories belonging only to the test should qualify for being marked destructive"? 17:28:18 nope 17:28:29 what is abadger2k's reason? 17:29:08 "created by the test" instead of "belonging" ? 17:29:21 ^ i would quallify outside of test/ or tmp dirs ... you might want to reuse resouces 17:29:22 bcoca: I think he's busy at the dentist, so didn't have time to explain his concerns. 17:30:19 "Lots of tests make sure packages are installed" 17:30:40 i think he's saying that checkmode package tests are technically non-destructive 17:30:49 ^ agreed 17:30:56 but in checkmode .. they are not modifying ... 17:30:59 so covered 17:31:48 might need to fix a few tests to 'skip rest' when that requirement is not met 17:32:24 bcoca: This is specifically for integration tests, so if requirements aren't present, we'll want to install them, thus making the tests destructive. 17:33:05 mattclay: that depends on how the test is run, we could have it both ways 17:33:32 check_mode: not destructive 17:33:48 ^ so if invoked via 'non destrcutive' make it chekc mode and skip 17:33:57 if invoked as destructive ... install and continue 17:34:08 That would require extensive modifications to the existing tests. 17:34:36 as well as changes to ansible-test 17:34:42 That too. 17:35:25 not saying we do for tomorrow, but its only way i see of having the cake and eating it 17:35:35 Considering we don't even have it working the way we want when there's only one way to run the tests, I think it's premature to try to support running them two different ways. 17:35:52 well, currently they are all 'destructive' 17:36:00 those that install packages 17:36:33 so we can mark them that way .. then transition to making them 'depend' on a) running in destructive/non and b) package is installed or not 17:37:15 which i agree, requires changes, but then would enable them to run on systems that already have the requirements w/o having to be destructive 17:37:20 I'm not sure there's enough benefit to supporting that mode of operation vs the cost of implementing it. 17:37:41 It's much easier to run the tests in a container or VM. 17:37:56 i see my personal benefit (i would start running integrations normally) ... but i'm probably the minority in this case 17:38:21 Instead I'd like to make it easier to use other containers or a VM, such as options for --lxd, --vagrant, etc. 17:38:26 xcept when the container bombs ... as our tests do on gentoo/docker (not just me, there is ONE other guy experiencing it) 17:38:49 mattclay: I would also prefer that 17:39:04 bcoca: What's your environment of choice for that? 17:39:10 lxc 17:39:18 i also use virtualbox 17:39:44 bcoca: Thanks. Added to my list. 17:39:52 mattclay: I'd be interested in helping make some VM images. I've actually been working on making vmware esxi images based on the chef bento packer files 17:40:12 the chef bento packer files have been a good starting point 17:40:31 they actually have vagrant build functionality in them 17:40:35 sivel: Before we do that we should finish moving the remaining test requirements into the tests. 17:40:49 no that is fine, and I'm not starting, but just letting you know 17:40:55 sivel: That way customized VM/container images are mostly optimizations. 17:41:11 i use geerlingguy's and the official vagrant boxes from the vendors. shouldn' need to make our own except to precache installs 17:41:34 jtanner: Exactly. Thats why I've been moving the requirements into the tests. 17:42:05 I don't touch vagrant at all, so having flexible alternatives is a + :) 17:42:24 staying out of the business of building VMs is always wise 17:42:31 OK, so back to the original topic. Is there any more to discuss on the description for what's destructive, or should I go with what we've discussed so far? 17:42:44 I'm good with what we have discussed 17:42:53 If so, I'll update the docs and add the missing `destructive` aliases. 17:43:03 changes outside the test dir == destructive. shipit 17:43:34 +1 17:43:51 I'd rather have a third category 17:44:02 abadger2k: What would you put in this other category? 17:44:16 outside test and tmp 17:44:32 semi destructive? 17:44:40 Yeah 17:46:57 abadger2k: Should we save the rest of this discussion for the next meeting so you're available to discuss? 17:47:27 abadger2k: Or is your other category something we could add later? 17:48:36 Mattclay go ahead with what you need to do... I'm obviously incapacitated enough that I can't be a good participant 17:49:07 #action mattclay to clarify in docs what qualifies as a destructive test 17:49:27 #action mattclay to add `destructive` alias to tests as needed 17:50:12 How about making tests destructive by default? What do people think about that? 17:50:19 +1 17:50:27 +1 17:50:28 +1 17:50:33 +1 17:50:36 easier and safer to mark 'non destructive' 17:51:45 #action mattclay to update ansible-test and tests to make destructive the default 17:53:19 Any other ideas or feedback on the handling of destructive tests? 17:54:26 wouldn't hurt if there were some documentation about how they are destructive, if known... 17:54:44 well, that will be the default now 17:54:46 aren't playbooks supposed to be documentation? ;) 17:54:56 sivel: exactly :) 17:54:57 "executable documentation" 17:55:46 i have said as much to some people, and they gave me a dirty look 17:56:18 "the playbook has comments. what more do you want?" 17:56:27 "pictures" 17:56:45 ASCII diagrams! 17:57:01 "video" 17:57:07 #topic Open Floor 17:57:28 Should not "test pull request" be added to "Issue Type" list in default GitHub pull request description ? 17:57:28 We're almost to the end of our scheduled time. Anything else before we end the meeting? 17:57:47 Pilou: if it does, i need to update the bot 17:58:11 Pilou: For PRs we can inspect the files changed. Any change to `./test/` will add the `testing_pull_request` label 17:58:20 bugfixes can include new tests, so i haven't pushed to make it either/or 17:58:23 jtanner: Would having that issue type be of any help to the bot? 17:58:34 jtanner: i saw this in bot source code 17:59:08 https://github.com/ansible/ansibullbot/blob/master/ansibullbot/utils/extractors.py#L276 18:01:38 yeah, it'll extract it properly but i'm not sure it will set the label correctly 18:01:48 k 18:02:04 if test pr is a real type that we want to promote/use, then yes it should be in the list of issue types in the template 18:03:03 my understanding was that PRs with tests should just be labeled "tests" to identify tests were included, but not override feature/bugfix as the top level type 18:03:24 What's the problem we are trying to solve? 18:03:45 - Should not "test pull request" be added to "Issue Type" list in default GitHub pull request description ? 18:04:02 That's not a problem 18:04:20 We already have test_pull_requests 18:05:41 fiddling around strace'ing some intg tests, 'subversion' might should be destructive . It sets up ~/.subversion if it doesn't exist and doesn't remove it. Unsure if it will modify 18:10:32 Anything else? 18:11:10 #endmeeting