Running HTTP virtual services without using proxies
When you run HTTP virtual services on HCL OneTest™ Server, the endpoint on which the virtual service is exposed externally uses a host name that includes a generated ID. If a client application is required to call the virtual service directly via its external host name and not via the HTTP proxy, then you might want to determine the host name to configure the client first before you start the virtual service.
Before you begin
- Been assigned the Tester or Owner role in the project to run the virtual services.
- Created a project on HCL OneTest™ Server and added the repository that contains the HTTP virtual services.
- Completed the prerequisite tasks before you start HTTP virtual services. See Prerequisites for running HTTP virtual services.
- Selected the branch of the Git repository to view test resources on the Execution page.
About this task
in-<unique_id>.<ingress_domain>For example, with an ingress domain as 10.1.2.3.nip.io, a stub endpoint might be as follows:
in-cd3a755635574c6fa7e264911301821a.10.1.2.3.nip.io
<ingress_domain_first_label>-<unique_id>.<remainder_of_ingress_domain>For example, with an ingress domain as ots.mycluster-123456-0000.region.containers.appdomain.cloud, a stub endpoint might be as follows:
ots-cd3a755635574c6fa7e264911301821a.mycluster-123456-0000.region.containers.appdomain.cloud
- The value of the <unique_id> that you specify is used as the <unique_id> for the stub.
- The <unique_id> must start and end with an alphanumeric character. The characters supported include a-z, 0-9, and a hyphen. No other characters can be used in the <unique_id>.
- The <unique_id> must be unique to a stub that is
running. Restriction: You must not assign the same <unique_id> to another stub that is running simultaneously. Doing so might result in an undefined behavior of the stub.
in-stub123-test.10.1.2.3.nip.io
Procedure
- Log in to HCL OneTest™ Server.
-
Open the project that contains the virtual service resources in the test assets by clicking
.The Overview page is displayed.
-
Click
in the navigation pane.
The Resources page is displayed.
-
Select the branch of the repository that contains the virtual services that you want to run from the list in the Branch field.
All virtual services in the selected branch are displayed on the Resources page.
- Identify the virtual service that you want to run.
-
Click the Execute icon in the row of the identified virtual service.
The Execute virtual service dialog box is displayed.
-
Select the version of the virtual service that is in the repository that you want to start by performing any of the following actions:
- Expand the list in the Version field, find the version of the test resources, and then select the version.Use the following details about the version of the test resources that are displayed to identify the version that you want:
- Commit message.
- Tags labeled for the version committed.
- The user who committed the version to the repository.
- Relative time of the commit. For example, 2 hours ago or 3 days ago.
The list displays the versions of the test resources committed by all users to the branch in the repository. The versions are arranged with the latest version committed followed by the versions committed previously.
- Expand the list in the Version field, and then search for the version that you want to select by entering a partial or the complete commit message of that version.
The version that matches the search criteria is displayed and it is selected for the test run.
- Expand the list in the Version field, find the version of the test resources, and then select the version.
-
Select the environment that was used to bind the physical and logical resource
in the API project, in the ENVIRONMENT tab.
Important: The configuration that you set for the run in the Execute virtual service dialog box is preserved when you run the same virtual service again. The configurations that you set are not available to other members when they want to run the virtual service. For example, if you selected an environment, the same environment is selected when you run the virtual service again.
-
Enter a label, if required.
A label that you enter for the test run that helps you to identify the virtual service instance on the Instances page. The label that you entered is displayed for the virtual service under the Labels column on the Instances page. After you have created a label, any member of the project can use that label.
-
Follow the instructions if you want to modify the configurations for the behavior of the virtual service:
-
Click Advanced to make the following advanced configurations:
- Click Execute.
Results
What to do next
- On the Resources page, the virtual services are displayed with the state as Running along with the number of instances that are running in the Active instances column.
- On the Resources page, you must click the Show in instances page icon in the row of the virtual service to view all the running instances of a particular virtual service on the Instances page.
- Go to the Instances page by clicking . You can view instances of all the virtual services that are running and are displayed with the state as Running under the State column. You can also view the requests that are received by the virtual service. The number of requests is displayed as number of hits when you hover the cursor over the text in the Activity column.