# US 2024/0256497 A1 · Testing templates used for implementing infrastructure as code

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0256497 A1
- Document ID: US20240256497A1
- Status: Published application
- Kind: A1
- Application number: 18/104,139
- Filed: 2023-01-31
- Published: 2024-08-01
- Earliest claimed: 2023-01-31
- Assignees: Salesforce, Inc.
- Applicants: Salesforce, Inc.
- Inventors: Zemann Phoesop Sheen; Abhishek B. Waichal; Srinivas Dhruvakumar
- Web page: https://patentgrep.com/patent/US20240256497A1

## CPC

- G06F 16/185: Hierarchical storage management [HSM] systems, e.g. file migration or policies thereof (details of archiving G06F16/11)
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system provides a framework for testing template code processed by a templating engine. A multitenant system may use template code for implementing Infrastructure as Code (IAC), for example, to generate pipelines for deploying software or provisioning resources for a datacenter configured in a cloud platform. The system sets the search path in a template engine environment object dynamically for each template file. The system allows testing of macros used by the template engine. The system converts the macros to callable entities that can be invoked by test cases. The system allows developers to finding code defects earlier and increase application availability. The system provides flexibility in testing and automation in running the tests. Furthermore, the system allows a separation of production code with unit tests.

## Claims

### Claim 1

A computer implemented method for generating pipelines for data centers configured on a cloud platform, the method comprising:
configuring a datacenter on the cloud platform based on a declarative specification specifying a hierarchy of datacenter entities;
identifying templates stored in a template directory in a file system;
matching directory structures of candidate directories in the file system with directory structure of the template directory;
determining location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;
setting path of a template based on the location of the test directory;
executing testing code in the test directory for testing the template;
responsive to successful completion of testing, executing the template to generate a set of pipelines configured for deployment of software artifacts on the datacenter configured on the cloud platform; and
executing the set of pipelines.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, wherein the test directory is identified based on a comparison of names of candidate directories with a predetermined name.

### Claim 3 (depends on 1)

The computer implemented method of claim 1, wherein determining location of the test directory comprises performing a traversal of a graph representation of the directory structure.

### Claim 4 (depends on 1)

The computer implemented method of claim 1, wherein matching directory structures of a candidate directory with directory structure of the template directory comprises comparing names of files in the candidate directory with names of files in the template directory to determine whether a test file exists in the candidate directory corresponding to a template file in the template directory.

### Claim 5 (depends on 1)

The computer implemented method of claim 1, wherein a template file has a file type from a plurality of file types, the plurality of file types having a precedence order, such that a file of a particular file type is selected as the template file based on the precedence order.

### Claim 6 (depends on 1)

The computer implemented method of claim 1, wherein the set of pipelines are configured to deploy a software artifact on datacenter entities of the datacenter configured on the cloud platform.

### Claim 7 (depends on 1)

The computer implemented method of claim 1, wherein the set of pipelines are configured to provision resources of the datacenter configured on the cloud platform.

### Claim at position 8

-14. (canceled)

### Claim 15

A computer system comprising:
a computer processor; and
a non-transitory computer readable storage medium for storing instructions that when executed by the computer processor, cause the computer processor to perform steps for configuring data centers in a cloud platform, the steps comprising;
configuring a datacenter on the cloud platform based on a declarative specification specifying a hierarchy of datacenter entities;
identifying templates stored in a template directory in a file system;
matching directory structures of candidate directories in the file system with directory structure of the template directory;
determining location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;
setting path of a template based on the location of the test directory;
executing testing code in the test directory for testing the template;
responsive to successful completion of testing, executing the template to generate a set of pipelines configured for deployment of software artifacts on the datacenter configured on the cloud platform; and
executing the set of pipelines.

### Claim 16 (depends on 15)

The computer system of claim 15, wherein the test directory is identified based on a comparison of names of candidate directories with a predetermined name.

### Claim 17 (depends on 15)

The computer system of claim 15, wherein determining location of the test directory comprises performing a traversal of a graph representation of the directory structure.

### Claim 18 (depends on 15)

The computer system of claim 15, wherein matching directory structures of a candidate directory with directory structure of the template directory comprises comparing names of files in the candidate directory with names of files in the template directory to determine whether a test file exists in the candidate directory corresponding to a template file in the template directory.

### Claim 19 (depends on 15)

The computer system of claim 15, wherein a template file has a file type from a plurality of file types, the plurality of file types having a precedence order, such that a file of a particular file type is selected as the template file based on the precedence order.

### Claim 20 (depends on 15)

The computer system of claim 15, wherein the set of pipelines are configured to deploy a software artifact on datacenter entities of the datacenter configured on the cloud platform or to provision resources of the datacenter configured on the cloud platform.

### Claim 21

A non-transitory computer-readable medium having instructions stored thereon that are capable of causing a computer system to implement operations comprising:
configuring a datacenter on a cloud platform based on a declarative specification specifying a hierarchy of datacenter entities;
identifying templates stored in a template directory in a file system;
matching directory structures of candidate directories in the file system with directory structure of the template directory;
determining location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;
setting path of a template based on the location of the test directory;
executing testing code in the test directory for testing the template;
responsive to successful completion of testing, executing the template to generate a set of pipelines configured for deployment of software artifacts on the datacenter configured on the cloud platform; and
executing the set of pipelines.

### Claim 22 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein the test directory is identified based on a comparison of names of candidate directories with a predetermined name.

### Claim 23 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein determining location of the test directory comprises performing a traversal of a graph representation of the directory structure.

### Claim 24 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein matching directory structures of a candidate directory with directory structure of the template directory comprises comparing names of files in the candidate directory with names of files in the template directory to determine whether a test file exists in the candidate directory corresponding to a template file in the template directory.

### Claim 25 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein a template file has a file type from a plurality of file types, the plurality of file types having a precedence order, such that a file of a particular file type is selected as the template file based on the precedence order.

### Claim 26 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein the set of pipelines are configured to deploy a software artifact on datacenter entities of the datacenter configured on the cloud platform.

### Claim 27 (depends on 21)

The non-transitory computer-readable medium of claim 21, wherein the set of pipelines are configured to provision resources of the datacenter configured on the cloud platform.
