1
00:00:00,000 --> 00:00:08,500
Hi, Let's understand how helm deployment can be tested. As a part of the chart

2
00:00:08,500 --> 00:00:15,233
We can include the test conditions as well as the test script also, and that can be used to do the testing.

3
00:00:15,233 --> 00:00:21,766
I'll show the demonstration of how to do the testing and we will have quick over view on how the test script will be.

4
00:00:21,766 --> 00:00:29,766
For example, I do have the following deployments. This particular deployment install upgrade rlbk -demo

5
00:00:29,766 --> 00:00:36,732
I can invoke the command helm test and then this particular deployment that's going to invoke the

6
00:00:36,733 --> 00:00:42,499
testing against this particular deployment, whether it is working properly or not.

7
00:00:42,500 --> 00:00:47,800
So it will try to make connection with the running pods and check whether it is able to make a successful

8
00:00:47,800 --> 00:00:56,000
connection or not. So it's able to make a successful connection and it's giving a message saying

9
00:00:56,000 --> 00:00:59,600
yes the test is sucess and how this is possible.

10
00:00:59,600 --> 00:01:05,633
Again, it is going to be a small pod condition that we will be defining it within the test folder.

11
00:01:05,633 --> 00:01:12,666
Let me get into the chart that we had created. Within templates

12
00:01:12,666 --> 00:01:15,032
There will be a folder called Test.

13
00:01:15,033 --> 00:01:18,766
So all the test conditions will be available over here.

14
00:01:18,766 --> 00:01:22,399
And I need to define what needs to be tested.

15
00:01:22,400 --> 00:01:27,533
So whatever the requirements or the templates that we are making that will be having corresponding

16
00:01:27,533 --> 00:01:35,099
test conditions. So all the test conditions that needs to be tested should get included in this particular folder test

17
00:01:35,100 --> 00:01:39,100
and within this particular file it's nothing but it's just another pod.

18
00:01:39,100 --> 00:01:42,766
And I need to have an annotation saying it is a hook. Hook

19
00:01:42,766 --> 00:01:50,832
It's going to get attached to the templates, but it will not get deployed as a manifest into the kubernetes cluster.

20
00:01:50,833 --> 00:01:57,833
We will be having detailed discussion about what this particular hook is and how it's going to get used

21
00:01:57,833 --> 00:02:00,233
Here I'll give a very quick over view

22
00:02:00,233 --> 00:02:06,999
Hook can get invoked in different stages say for example before deployment, after deployment, after rendering

23
00:02:07,000 --> 00:02:11,900
There are different stages where it will get invoked. In this particular case after deployment it will get

24
00:02:11,900 --> 00:02:17,800
invoked during the testing it's going to run this particular container.

25
00:02:17,800 --> 00:02:23,766
So this particular container its going to get an image called busy box and it will do a wget against

26
00:02:23,766 --> 00:02:27,432
this particular deployment and the port.

27
00:02:27,433 --> 00:02:29,999
So it'll try to ping that particular pod.

28
00:02:30,000 --> 00:02:33,300
And if it is available say, that service in the port

29
00:02:33,300 --> 00:02:38,600
If it is able to get the message, then it is going to provide a message saying its success or otherwise

30
00:02:38,600 --> 00:02:46,800
it's going to give a failure. In case if I list the pods I can check

31
00:02:46,800 --> 00:02:52,233
There is a pod which got started for the test connection and it got over.

32
00:02:52,233 --> 00:02:54,333
This is how the testing will be achieved.

33
00:02:54,333 --> 00:02:57,299
say for what condition needs to be tested

34
00:02:57,300 --> 00:03:03,700
The corresponding pod will get invoked using some commands and the output of the command will determine

35
00:03:03,700 --> 00:03:09,000
whether that particular pods or service is working properly or not.

36
00:03:09,000 --> 00:03:12,366
And mostly it will be testing against the exit condition.

37
00:03:12,366 --> 00:03:15,299
A successful exit that is exit zero.

38
00:03:15,300 --> 00:03:20,966
And the important thing to be consider is that particular annotation saying it is the hook.

39
00:03:20,966 --> 00:03:23,032
So here I need to have a condition.

40
00:03:23,033 --> 00:03:29,533
And as a part of the hook, we will discuss more about how to write this particular cases, different type of events

41
00:03:29,533 --> 00:03:35,833
When the hook can get triggered. The sample conditions where we can run is whether the user name, password

42
00:03:35,833 --> 00:03:37,533
is working properly or not.

43
00:03:37,533 --> 00:03:43,333
The environmental variable that we have provided as a part of the helm deployment got injected properly

44
00:03:43,333 --> 00:03:47,633
into the required entities like services or pods or not

45
00:03:47,633 --> 00:03:54,899
And mostly we will be doing the asset of the services whether it is up and running and load balancing

46
00:03:54,900 --> 00:04:01,766
it properly or not. These are all some of the test conditions that we can do by using this particular test option.

47
00:04:01,766 --> 00:04:06,299
It purely depends on the condition that we are running within the test cases.

