kalliope-project / kalliope

Kalliope is a framework that will help you to create your own personal assistant.
https://kalliope-project.github.io/
GNU General Public License v3.0
1.71k stars 230 forks source link

External Dependency or Mystery Guest in Test Code #652

Closed Talismanic closed 3 years ago

Talismanic commented 3 years ago

Greetings, I am an engineer who is interested in infrastructure as code testing. Currently, I am looking for testing anti-patterns in iac test scripts. I noticed external dependency or mystery guests are occurring in test instances by using external URLs or json data files. As a consequence of this, the test script violates the principle of self-containment. So only looking at the current test script, it will not be comprehendible what testing will actually be done by that particular script. I think this is an anti-pattern of testing practices.

So I have the following query:

Do you agree that this is an IaC testing anti-pattern? Do you want to fix this?

Any feedback is appreciated.

Source File:

https://github.com/kalliope-project/kalliope/blob/master/kalliope/neurons/uri/tests/uri_test_brain.yml

Sispheor commented 3 years ago

This file seems not used by the tests.

Talismanic commented 3 years ago

I was not actually spamming. I was trying to understand from different persons of the community about their perception of testing anti-patterns. Sorry if it has annoyed you.

Sispheor commented 3 years ago

Sorry but it looks like spam. You just identified an url in a file and with no more investigation you just created this issue. Github is now full of bot that does this kind of behavior.

Talismanic commented 3 years ago

If you have time, you can help me with some feedback from you about my intention. Do you really feel that having a dependency on external URLs in the test script can create problem at some point in the life cycle? For example, if we download some data from the url and use that in our test script (may be as some config info or anything), there can be probability of the below things:

  1. If the URL is changed and we are not notified, our testing will fail.
  2. If we test in some environment which does not have firewall connectivity with this URL, test will fail.

Again, you feedback is highly appreciated.

Sispheor commented 3 years ago

Yes it's what we call unit test. And that's why we don't have this in our test. And so that's why this issue is not valid.

Talismanic commented 3 years ago

So, in your opinion, having external urls in Unit Test can cause problem. As you are not doing unit test here, my issue is irrelevant for you.

Thanks again for responding to my queries. Much appreciated. I rest my case here.