IP Library Granted Patent US 12,259,851
Granted Patent B2
US 12,259,851 · App. 18/104,139 · Granted Mar 25, 2025

Testing templates used for implementing infrastructure as code

Inventors: Zemann Phoesop Sheen (San Francisco, CA); Abhishek B. Waichal (Fremont, CA); Srinivas Dhruvakumar (Vancouver, CA)
Assignee: Salesforce, Inc.
G06F16/185G06F11/3688
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,259,851
App. No.
18/104,139
Filed
Jan 31, 2023
Granted
Mar 25, 2025
Kind
B2
Art Unit
2165
USPC
707/610
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 (50)

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 at least one template stored in a template directory in a file system;

identifying a set of macros defined in the template;

converting macros in the set of macros to a set of callable entities;

matching directory structures of candidate directories in the file system with a directory structure of the template directory;

determining a location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;

setting a path of the template based on the location of the test directory;

executing testing code in the test directory for testing the template, wherein executing the testing code invokes the set of callable entities corresponding to the set of macros defined in the template; and

responsive to successful completion of executing the testing code for testing the template, executing the template to generate a set of pipelines to deploy software artifacts corresponding to the successfully tested template on the datacenter configured on the cloud platform.

2. 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.

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

4. The computer implemented method of claim 1 , wherein matching a directory structure of a candidate directory with the 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.

5. 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.

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

7. 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.

8. 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 at least one template stored in a template directory in a file system;

identifying a set of macros defined in the template;

converting macros in the set of macros to a set of callable entities;

matching directory structures of candidate directories in the file system with directory structure of the template directory;

determining a location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;

setting a path of the template based on the location of the test directory;

executing testing code in the test directory for testing the template, wherein executing the testing code invokes the set of callable entities corresponding to the set of macros defined in the template; and

responsive to successful completion of executing the testing code for testing the template, executing the template to generate a set of pipelines to deploy software artifacts corresponding to the successfully tested template on the datacenter configured on the cloud platform.

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

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

11. The computer system of claim 8 , wherein matching a directory structure of a candidate directory with the 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.

12. The computer system of claim 8 , 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.

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

14. 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 at least one template stored in a template directory in a file system;

identifying a set of macros defined in the template;

converting macros in the set of macros to a set of callable entities;

matching directory structures of candidate directories in the file system with directory structure of the template directory;

determining a location of a test directory in the file system as a candidate directory matching the directory structure of the template directory;

setting a path of the template based on the location of the test directory;

executing testing code in the test directory for testing the template, wherein executing the testing code invokes the set of callable entities corresponding to the set of macros defined in the template; and

responsive to successful completion of executing the testing code for testing the template, executing the template to generate a set of pipelines to deploy software artifacts corresponding to the successfully tested template on the datacenter configured on the cloud platform.

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

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

17. The non-transitory computer-readable medium of claim 14 , wherein matching a directory structure of a candidate directory with the 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.

18. The non-transitory computer-readable medium of claim 14 , 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.

19. The non-transitory computer-readable medium of claim 14 , wherein the set of callable entities correspond to a programming language of the template, and wherein the operations further comprise:

generating a module in the programming language, the module storing the set of callable entities, wherein executing the testing code invokes the set of callable entities by executing the module.

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

Assignments (2)
CHANGE OF NAME Recorded Oct 30, 2023
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 065394/0169 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 14, 2023
From: SHEEN, ZEMANN; WAICHAL, ABHISHEK B.; DHRUVAKUMAR, SRINIVAS
To: SALESFORCE, INC.
Reel/Frame 062692/0915 →
Continuity (1)
Related Publication 20240256497A1 · Aug 1, 2024
References Cited (29)
US 5634098A · Janniro · 1997 [cited by examiner]
US 10318285B1 · Jodoin et al. · 2019 [cited by applicant]
US 10320625B1 · Cherumbath · 2019 [cited by examiner]
US 10334058B2 · Frank et al. · 2019 [cited by applicant]
US 11237880B1 · Raumann · 2022 [cited by examiner]
US 11392366B1 · Wiegley · 2022 [cited by examiner]
US 20120180024A1 · Gonzalez et al. · 2012 [cited by applicant]
US 20130311164A1 · Katz · 2013 [cited by examiner]
US 20140281721A1 · Navalur · 2014 [cited by examiner]
US 20180048521A1 · Nair et al. · 2018 [cited by applicant]
US 20180329738A1 · Kasha et al. · 2018 [cited by applicant]
US 20180364985A1 · Liu et al. · 2018 [cited by applicant]
US 20190095320A1 · Biswas · 2019 [cited by examiner]
US 20190129712A1 · Hawrylo et al. · 2019 [cited by applicant]
US 20190138288A1 · Brealey et al. · 2019 [cited by applicant]
US 20200117434A1 · Biskup et al. · 2020 [cited by applicant]
US 20200125344A1 · Varghese et al. · 2020 [cited by applicant]
US 20210232388A1 · Mirantes et al. · 2021 [cited by applicant]
US 20220012170A1 · Mukherjee · 2022 [cited by examiner]
US 20220236976A1 · Wiegley · 2022 [cited by examiner]
US 20220253333A1 · Rizzi · 2022 [cited by examiner]
US 20220311795A1 · Hutelmyer · 2022 [cited by examiner]
Austel, P. et al., “Continuous Delivery of Composite Solutions: A Case for Collaborative Software Defined PaaS Environments,” BigSystem '15, Jun. 2015, pp. 3-6. [cited by applicant]
Burns, E. et al., “Continuous Delivery with Spinnaker,” May 11, 2018, XP055626768, pp. 1-81. [cited by applicant]
Burns, E., “Why Spinnaker matters to CI/CD,” Aug. 27, 2019, ten pages, [Online] [Retrieved on Jun. 25, 2021] Retrieved from the Internet <URL: https://opensource.com/article/19/8/why-spinnaker-matters-cicd>. [cited by applicant]
Mukherjee, J., “Continuous delivery pipeline 101: What is a continuous delivery pipeline?,” Date Unknown, 14 pages, [Online] [Retrieved on Jun. 25, 2021] Retrieved from the Internet <URL: https://www.atlassian.com/conti… [cited by applicant]
PCT International Search Report and Written Opinion, PCT Application No. PCT/US2021/015822, Jul. 15, 2021, 19 pages. [cited by applicant]
Thakur, V., “Continuous Delivery Pipeline for Kubernetes Using Spinnaker,” May 27, 2020, 21 pages, [Online] [Retrieved on Jun. 25, 2021] Retrieved from the Internet <URL: https://www.metricfire.com/blog/continuous-deliv… [cited by applicant]
United States Office Action, U.S. Appl. No. 17/112,974, filed Aug. 16, 2021, 30 pages. [cited by applicant]