Serverless Kubernetes end-to-end test method and test system
By introducing an automated system of test case management, execution and reporting management modules in Serverless Kubernetes, the problem of difficult and inefficient test case maintenance in end-to-end testing of Serverless Kubernetes is solved, and a more efficient and accurate testing process is achieved.
Patent Information
- Application Number
- CN202411746324.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-04-15
AI Technical Summary
Existing end-to-end Kubernetes testing methods cannot be directly applied to Serverless Kubernetes, and test cases are difficult to maintain, resulting in inefficiency in testing.
Provides an end-to-end testing method and testing system for Serverless Kubernetes, including a test case management module, a test case execution module and a test report management module. It automatically creates and manages test projects and versions, automatically executes test cases and generates test reports.
It reduces the difficulty of maintaining test cases, improves testing efficiency, ensures the comprehensiveness and accuracy of tests, and reduces the risks of manual intervention and errors.
Smart Images

Figure CN119829423A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of Serverless Kubernetes testing, and in particular to an end-to-end testing method and testing system for Serverless Kubernetes. Background Art
[0002] Although both Kubernetes and Serverless Kubernetes are based on container technology and are used to manage containerized workloads and services, Serverless Kubernetes provides a higher level of abstraction on this basis, simplifies the operation and maintenance of infrastructure, and allows users to focus more on application development.
[0003] The existing Kubernetes end-to-end testing methods based on Ginkgo and Gomega cannot be directly applied to Serverless Kubernetes, and the existing Kubernetes end-to-end testing methods have the problem of low testing efficiency due to the difficulty in maintaining test cases. Therefore, in the Serverless Kubernetes end-to-end testing scenario, how to reduce the difficulty of test case maintenance and improve testing efficiency has become a problem that needs to be solved. Summary of the invention
[0004] In view of this, the present disclosure provides an end-to-end testing method and testing system for Serverless Kubernetes to solve the problem of how to reduce the difficulty of test case maintenance and improve testing efficiency in the Serverless Kubernetes end-to-end testing scenario.
[0005] On the one hand, the present disclosure provides an end-to-end testing method for Serverless Kubernetes, which is applied to a testing system. The testing system includes: a test case management module, a test case execution module and a test report management module. The method includes: a test case management module, which creates a test project corresponding to a test object and at least one test version in the test project, and determines an end-to-end test case and an end-to-end test script for each test version in at least one test version; a test case execution module, which executes an end-to-end test script corresponding to an end-to-end test case in each test version, and generates a test report for the end-to-end test case; a test report management module, which manages the life cycle of the test report and provides test report information to testers.
[0006] On the other hand, the present disclosure also provides a test system, which includes a test case management module, a test case execution module and a test report management module, wherein: the test case management module is used to create a test project corresponding to the test object and at least one test version in the test project, and determine the end-to-end test case and end-to-end test script of each test version in at least one test version; the test case execution module is used to execute the end-to-end test script corresponding to the end-to-end test case in each test version, and generate a test report for the end-to-end test case; the test report management module is used to manage the life cycle of the test report and provide the test report information to the tester.
[0007] On the other hand, the present disclosure further provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to implement the above-mentioned Serverless Kubernetes end-to-end testing method.
[0008] On the other hand, the present disclosure further provides a computer program product, including computer instructions, which are used to enable a computer to execute the above-mentioned Serverless Kubernetes end-to-end testing method.
[0009] Through the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiments of the present invention, by introducing a test case management module, the test case management module is used to automatically create test projects and versions, and the test cases and test scripts corresponding to the test versions are clearly defined. This automated management greatly reduces manual intervention and reduces the difficulty of test case maintenance, thereby improving testing efficiency.
[0010] In addition, the test case execution module can automatically execute end-to-end test cases in each version, and the test scripts strictly correspond to the test cases to ensure the comprehensiveness and accuracy of the test, thereby enabling testers to complete a large amount of testing work more quickly and further improve testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0012] Figure 1aAn exemplary schematic diagram showing the architecture of a test system applied to an end-to-end test method of Serverless Kubernetes according to an embodiment of the present disclosure;
[0013] Figure 1b It is a flowchart of an end-to-end testing method for Serverless Kubernetes provided in an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of an end-to-end test case template of an end-to-end test method for Serverless Kubernetes according to an embodiment of the present disclosure is shown;
[0015] Figure 3 An exemplary schematic diagram showing the architecture of another test system applied to an end-to-end test method of Serverless Kubernetes according to an embodiment of the present disclosure;
[0016] Figure 4 A specific flow chart of another end-to-end testing method for Serverless Kubernetes according to an embodiment of the present disclosure is shown;
[0017] Figure 5 A schematic diagram of a test project creation process of an end-to-end test method for Serverless Kubernetes according to an embodiment of the present disclosure is shown;
[0018] Figure 6 A schematic diagram of a test version creation process of an end-to-end testing method for Serverless Kubernetes according to an embodiment of the present disclosure is shown;
[0019] Figure 7 A schematic diagram of the test case and test script association process of an end-to-end testing method for Serverless Kubernetes according to an embodiment of the present disclosure is shown;
[0020] Figure 8 is a structural schematic diagram of another test system provided by an embodiment of the present disclosure;
[0021] Fig. 9 It is a structural diagram of another test system provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] Kubernetes (k8s) and Serverless Kubernetes are both container-based platforms for managing containerized workloads and services. Kubernetes provides a powerful infrastructure to help developers build, deploy, and manage containerized applications, while Serverless Kubernetes provides a higher level of abstraction on this basis, simplifying the management of infrastructure and allowing users to focus more on application development without having to worry about the operation and maintenance of the underlying infrastructure. Although the two have many similarities in container management, Serverless Kubernetes solves some of the challenges of Kubernetes in management complexity through automation and a higher level of abstraction.
[0023] As the complexity of these systems increases, traditional manual testing methods gradually expose their limitations, especially when they cannot be reused and executed efficiently during the testing process. In contrast, end-to-end testing can simulate real user scenarios, verify the integration and data consistency between the system and its various components, and not only focus on the functionality of each module, but also emphasize the interaction and coordination between modules, thereby improving testing efficiency and system stability.
[0024] However, the Kubernetes end-to-end testing method based on Ginkgo and Gomega provided by the open source community cannot be directly reused for Serverless Kubernetes, mainly because there are certain differences in their functions.
[0025] In addition, the native Kubernetes end-to-end test may have the following problems during execution:
[0026] 1. Kubernetes end-to-end testing requires a complete Kubernetes cluster environment, which means that testers need to configure and manage a highly complex cluster, and testing usually requires simulating the interaction between multiple cluster environments and services. Due to the complexity of the configuration of the Kubernetes cluster and its related components, the threshold for testing is relatively high.
[0027] 2. With the update of Kubernetes version, the cluster configuration and interface and other contents will change. The end-to-end test cases of native Kubernetes need to be constantly adjusted according to the version update. Each version change will affect the applicability of the test cases, increase the maintenance workload, and make the test case maintenance difficult.
[0028] 3. Native Kubernetes test reports are usually generated by different tools. The test report formats they output may be inconsistent, causing testers to spend extra time parsing and understanding the report content, affecting the readability of the test report.
[0029] To solve the above problems, various embodiments of the present disclosure provide an end-to-end testing method for Serverless Kubernetes, which is applied to a testing system. The testing system includes: a test case management module, a test case execution module and a test report management module. The method includes: a test case management module, which creates a test project corresponding to a test object and at least one test version in the test project, and determines an end-to-end test case and an end-to-end test script for each test version in at least one test version; a test case execution module, which executes an end-to-end test script corresponding to an end-to-end test case in each test version, and generates a test report for the end-to-end test case; a test report management module, which manages the life cycle of the test report and provides test report information to testers.
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0031] Please refer to Figure 1a , Figure 1a An exemplary schematic diagram of the architecture of a test system applied to an end-to-end test method of Serverless Kubernetes in an embodiment of the present disclosure is shown. Figure 1a As shown, the test system may include: a test case management module, a test case execution module and a test report management module.
[0032] like Figure 1a As shown in the figure, the test system can be deployed in Serverless Kubernetes or independently of Serverless Kubernetes.
[0033] The test case management module can be used to manage the creation, maintenance, organization, and version control of all test cases in the entire Serverless Kubernetes end-to-end testing process. The test case execution module can be used to automatically execute test cases and generate corresponding test reports based on the execution results. The test report management module can be used to collect, organize, store, and display test reports of test execution.
[0034] Further references Figure 1b , Figure 1b This is a flow chart of an end-to-end testing method for Serverless Kubernetes provided in an embodiment of the present disclosure, which is applied to the above Figure 1a The test system shown in the figure may include the following steps:
[0035] Step S101: A test case management module creates a test project corresponding to a test object and at least one test version in the test project, and determines an end-to-end test case and an end-to-end test script for each test version in the at least one test version.
[0036] In this embodiment, end-to-end (E2E) testing may refer to a technique for testing the entire software product from beginning to end to ensure that the application process runs as expected. It defines the system dependencies of the product and ensures that all integrated parts work together as expected. The main purpose of this type of testing is to simulate real user scenarios, verify the integration and data integrity of the system under test and its components, and mainly test from the end user's experience.
[0037] The test object may refer to the Serverless Kubernetes to be tested. A test project corresponding to the Serverless Kubernetes to be tested is created in the test system. The test project is used to centrally manage the test content related to the Serverless Kubernetes to be tested.
[0038] The test version in a test project can refer to a specific version of Serverless Kubernetes to be tested. Each test version can contain at least one end-to-end test case, and each end-to-end test case can be used to verify a functional point in the test version.
[0039] Here, each test version may include at least one end-to-end test case, an end-to-end test case may include at least one scenario, and each scenario may include at least one test case.
[0040] Here, a scenario can refer to specific operation steps and expected results under different test paths or conditions in an end-to-end test case.
[0041] End-to-end test cases are different from conventional test cases. End-to-end test cases need to consider the interaction of multiple modules and components and test the integration of multiple system functions, while conventional test cases often focus on testing a specific functional point.
[0042] An end-to-end test case can correspond to an end-to-end test script. The end-to-end test script can be an automated test code written according to the scenarios and expected behaviors defined in the end-to-end test case. By calling the application programming interface (API), simulating user behaviors or performing system operations, the end-to-end test case is automatically executed to verify whether the various functional modules of the system work correctly.
[0043] In a possible implementation, in order to ensure consistency of test execution, the end-to-end test case may be bound to the end-to-end test script.
[0044] Step S102: The test case execution module executes the end-to-end test script corresponding to the end-to-end test case in each test version, and generates a test report for the end-to-end test case.
[0045] In this embodiment, the test case execution module starts the execution of end-to-end test cases, wherein the end-to-end test cases in each test version are executed through the bound end-to-end test scripts; the test case execution module collects the execution results of each test case in real time during the test execution process, and generates a test report for the end-to-end test case based on the execution results.
[0046] As an example, the test report of an end-to-end test case may include at least one of the following: an end-to-end test case ID, test version information, detailed information of test execution, test case execution results, and test conclusions.
[0047] In a possible implementation, the test report of the generated end-to-end test case may be saved in a format including, but not limited to, HTML, PDF, etc., to ensure that the tester can view and understand it intuitively.
[0048] Step S103: the test report management module manages the life cycle of the test report and provides the test report information to the tester.
[0049] In this embodiment, the test report management module can save the generated test report of the end-to-end test case in the database, file system or cloud storage of the test system. When storing the test report, the test report management module can save the test report in association with the test version, test case, tester and other information.
[0050] Furthermore, when the test report is updated at least once over time, the test report management module can perform version control on the test reports of different test versions to ensure that each test version of the report can be traced.
[0051] Here, if an end-to-end test case or test version is fixed and re-executed, the test report management module can update the previous failed test report and store the new execution results in the test report. For regression tests or reports with multiple iterations, the test report management module can support merging the old report with the new report and updating the overall report content.
[0052] In a possible implementation, the method may further include:
[0053] The test report management module sets the access rights of relevant users for different test reports, so that users with different roles can only access the test reports within the corresponding permission range. The relevant users include but are not limited to: testers, developers, product managers, etc.
[0054] In a possible implementation, the method may further include: a test report management module that regularly deletes expired test reports based on an expiration management function.
[0055] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiments of the present disclosure, by introducing a test case management module, the test case management module is used to automatically create test projects and versions, and the test cases and test scripts corresponding to the test versions are clearly defined. This automated management greatly reduces manual intervention and reduces the difficulty of test case maintenance, thereby improving testing efficiency. The test case execution module can automatically execute end-to-end test cases in each version, and the test scripts strictly correspond to the test cases to ensure the comprehensiveness and accuracy of the test, thereby enabling testers to complete a large amount of testing work more quickly and further improve testing efficiency. The test execution module automatically runs end-to-end test cases and generates test reports, saving a lot of manual operation time and greatly reducing the risk and omissions of manual errors.
[0056] In a possible implementation of the above step S101, the test case management module creates a test item corresponding to the test object, including:
[0057] The test case management module determines whether the Serverless Kubernetes end-to-end test project of the test object has been created. If it is determined that the end-to-end test project has not been created, it creates the end-to-end test project.
[0058] The test case management module, when it is determined that the end-to-end test project has been created, determines whether the end-to-end test project has been bound to the Git repository; when it is determined that the end-to-end test project has not been bound to the Git repository, binds the end-to-end test project to the Git repository.
[0059] In this embodiment, the test case management module determines whether the ServerlessKubernetes end-to-end test project of the test object has been created, which may include:
[0060] The test case management module checks whether there are end-to-end test projects for Serverless Kubernetes.
[0061] If it is confirmed that it already exists, there is no need to create it again. If it is confirmed that it does not exist, proceed to the next step of creating an end-to-end test project.
[0062] The test case management module determines whether the end-to-end test project is bound to the Git repository. If it is determined that the end-to-end test project is not bound to the Git repository, the end-to-end test project is bound to the Git repository, which may include:
[0063] The test case management module determines whether the end-to-end test project is bound to the Git repository. If it is determined that the end-to-end test project is not bound to the Git repository, it determines whether the Git repository exists.
[0064] When the Git repository is confirmed to exist, bind the Git repository to the end-to-end test project;
[0065] When it is determined that the Git repository does not exist, initialize the Git repository and bind it to the end-to-end test project.
[0066] Here, the Git repository can be a version control system for storing and managing project code. The Git repository can save the complete history of the project, allow multi-user collaborative development, and track changes to each file and directory. Among them, the Git repository can include at least one Git branch, and each Git branch can store and manage an end-to-end test script for a test version.
[0067] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiment of the present disclosure, by checking whether the corresponding end-to-end test project already exists, duplicate creation is avoided, thereby improving the efficiency and accuracy of test project management. When the end-to-end test project has not yet been bound to the Git repository, the system will automatically check and determine whether the corresponding Git repository already exists. If the warehouse already exists, it will be automatically bound. If the warehouse does not exist, the system will automatically initialize a new Git repository and complete the binding. This automated process reduces manual intervention, ensures the correct association between the Git repository and the test project, and effectively avoids human errors. The automated creation and binding process lowers the operational threshold for test case management, especially in complex environments involving multiple versions and warehouses. The automated steps reduce the need for manual intervention, allowing testers to configure and manage projects more easily.
[0068] In a possible implementation of the above step S101, the test case management module creates at least one test version in the test project based on the following steps:
[0069] A test case management module determines whether a test version already exists in the end-to-end test project, and when it is determined that no test version exists in the end-to-end test project, creates at least one test version in the end-to-end test project;
[0070] The test case management module determines whether each test version in at least one test version is bound to a corresponding Git test project branch. When it is determined that each test version is not bound to a Git test project branch, the Git repository is initialized to bind each test version to a corresponding Git test project branch.
[0071] In this embodiment, the test case management module determines whether a test version already exists in the end-to-end test project, and when it is determined that the test version does not exist in the end-to-end test project, creates at least one test version in the end-to-end test project, which may include:
[0072] The test case management module determines whether a corresponding test version already exists in the current end-to-end test project by querying the version information of the test version. If it is determined that there is an existing test version, the existing test version can be selected for testing; if it is determined that there is no test version, proceed to the next step to create a new test version.
[0073] The test case management module, when it is determined that each test version is not bound to a Git test project branch, initializes the Git repository and binds the corresponding Git test project branch to each test version, which may include:
[0074] The test case management module, when it is determined that each test version is not bound to a Git test project branch, determines whether there is a Git branch corresponding to the test version. When it is determined that there is a Git branch corresponding to the test version, binds the Git branch to the test version. When there is no Git branch corresponding to the test version, initializes a new Git branch and binds it to the test version.
[0075] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiment of the present disclosure, through the automated version management and Git branch binding functions of the test case management module, the system can effectively manage the relationship between the test version and the test script of each test project, reduce manual intervention, improve the efficiency and accuracy of the test, and ensure the consistency of the test environment. This automated process helps reduce human errors, saves configuration time, and ensures the scalability and maintainability of the test project, ultimately improving the reliability and quality of the test.
[0076] In a possible implementation of the above step S101, the test case management module determines the end-to-end test cases and end-to-end test scripts of each test version in at least one test version, based on the following steps:
[0077] A test case management module generates an end-to-end test case for each test version based on an end-to-end test case template, wherein the end-to-end test case template includes at least one of the following: a function to be tested, a scenario to be tested in the function to be tested, and a test case in the scenario to be tested;
[0078] The test case management module generates an end-to-end test script for each test version based on the end-to-end test script template. The end-to-end test script template includes at least one of the following: a function to be tested, a scenario to be tested, and specific test steps.
[0079] In this embodiment, the method may include: a test case management module, determining whether the corresponding end-to-end test cases and end-to-end test scripts already exist in the test version; when it is determined that they already exist in the test version, skipping the step of generating the end-to-end test cases and end-to-end test scripts; when it is determined that they do not exist in the test version, generating the end-to-end test cases and end-to-end test scripts in the test version.
[0080] The function to be tested may refer to a function point or module that needs to be tested in Serverless Kubernetes. The scenario to be tested in the function to be tested may refer to a scenario that needs to be tested in the function to be tested. The test case in the scenario to be tested may refer to a specific test case that needs to be executed in each scenario.
[0081] The test case management module generates end-to-end test cases for the test version based on the end-to-end test case template according to the relationship between functions, scenarios and test cases in the test version. Each test version will contain one or more end-to-end test cases to ensure that all functions and scenarios are covered.
[0082] As an example, an end-to-end test case template could be Figure 2 As shown, Figure 2A schematic diagram of an end-to-end test case template of an end-to-end testing method for Serverless Kubernetes in an embodiment of the present disclosure is shown, wherein the end-to-end test case template may include at least one function, each function may include at least one scenario, and each scenario may include at least one test case.
[0083] Furthermore, the function to be tested in the end-to-end test script template may refer to the function or module to be verified corresponding to the end-to-end test script, the scenario to be tested may refer to the occasion or environment for testing the behavior of the function under specific conditions, and the specific test steps may be specific operation steps used to verify the test function and scenario, which may include but are not limited to how the user interacts with the system, expected input, operation sequence and expected results.
[0084] The test case management module generates an end-to-end test script for each test version based on the end-to-end test script template, and may include: the test case management module fills in specific parameters in the end-to-end test script template according to the function and scenario information of the test version, dynamically generates the corresponding end-to-end test script, and binds the generated end-to-end test script to a specific Git branch in the Git repository of the test version.
[0085] Here, an end-to-end test script can correspond to a .go file, that is, the end-to-end test script can be developed based on the open source GinkGO test framework and Gomega assertion library.
[0086] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiments of the present disclosure, by defining templates of end-to-end test cases and scripts, the consistency of the structure and content of the test cases and scripts of each test version is ensured, avoiding the risk of omissions or errors in the manual writing process. By automatically generating test cases and scripts, the workload of manually creating tests is reduced. Each time a new version is released or changed, test cases and scripts can be quickly and accurately generated according to the template, significantly improving the efficiency of the test preparation stage. The use of templates centrally manages the structure of test cases and scripts, making the test framework more modular and easy to maintain.
[0087] In a possible implementation of the above embodiment, the method further includes:
[0088] A test case management module, determining whether an end-to-end test case of each test version in at least one test version is bound to an end-to-end test script, and when it is determined that the end-to-end test case is not bound to the end-to-end test script, determining whether an end-to-end test script exists in the test version;
[0089] The test case management module generates an end-to-end test script based on an end-to-end test script template and binds the end-to-end test script to the end-to-end test case when it is determined that the end-to-end test script does not exist in the test version.
[0090] In this embodiment, the method further includes: a test case management module, when determining that an end-to-end test script exists in the test version, binding the end-to-end test script with the end-to-end test case.
[0091] When the test case is successfully bound to the end-to-end test script, the binding process ends and the test case management module ensures that all test cases are associated with the correct script and is ready to enter the execution phase of the end-to-end test script.
[0092] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiments of the present disclosure, by automatically checking, generating and binding test scripts, the time of manual operation is reduced and the test preparation cycle is shortened. The binding between each test case and script ensures the traceability of the test process, making the test process clearer and more manageable.
[0093] In a possible implementation of the above step S102, the test case execution module executes the end-to-end test script corresponding to the end-to-end test case in each test version and generates a test report for the end-to-end test case based on the following steps:
[0094] The test case execution module selects the test version of the test object and the end-to-end test cases in the test version;
[0095] A test case execution module executes at least one end-to-end test script in the end-to-end test case, and when the end-to-end test script of the end-to-end test case fails to execute, sends execution failure information to the tester based on a preset notification method;
[0096] The test case execution module generates a test report for the end-to-end test case after the end-to-end test script of the end-to-end test case is executed.
[0097] In this embodiment, the test case execution module selects the test object to be executed and the corresponding test version. After selecting the test version, the end-to-end test case in the version is selected; according to the requirements of the end-to-end test case, the relevant end-to-end test scripts are executed one by one.
[0098] During the execution process, the end-to-end test script automatically interacts with the resources in the test system to simulate real user behavior or system scenarios.
[0099] The test case execution module, when detecting that the end-to-end test script execution fails during the execution process, sends the execution failure information to the tester using the preset notification method including but not limited to: instant message, email, and other notification methods.
[0100] The execution failure information sent may include a hyperlink, and the hyperlink is used to jump to a related test interface when the tester clicks it.
[0101] In the end-to-end testing method and testing system of Serverless Kubernetes in the above-mentioned embodiment of the present disclosure, by automatically executing the test script of the end-to-end test case, manual intervention is reduced and the speed and accuracy of test execution are improved. When the test script fails to execute, the preset notification method can immediately send a notification of execution failure to the tester. In this way, the tester can obtain information about the test failure in a timely manner to avoid delays in subsequent work caused by test failure.
[0102] In a possible implementation of the above embodiment, the method further includes: a test case execution module that improves the end-to-end test case and the end-to-end test script in the end-to-end test case according to feedback information in the test report of the end-to-end test case.
[0103] In this implementation, the test case execution module extracts all failed test cases and the specific error information of each test case from the test report, analyzes the cause of failure based on the specific error information, and improves the end-to-end test cases and the end-to-end test scripts in the end-to-end test cases according to the cause of failure.
[0104] In the end-to-end testing method and testing system of Serverless Kubernetes in the above embodiments of the present disclosure, the test cases and scripts are continuously improved through feedback on failures, making the test more comprehensive and accurate. The improved test cases and scripts can reduce false positives and false negatives and improve the stability and reliability of the test.
[0105] In a specific embodiment, Figure 3 An exemplary schematic diagram of the architecture of another test system applied to an end-to-end test method of Serverless Kubernetes according to an embodiment of the present disclosure is shown, wherein:
[0106] The test platform (i.e., the test system) and Gitlab (i.e., the Git warehouse) together form an end-to-end test architecture, wherein the test platform includes a test case management module, a test case execution module, and a test report management module. The test case management module includes at least one test version (such as V1.0.0 in the figure), each test version includes at least one end-to-end test case, each test version is associated with the Git branch corresponding to the test version in Gitlab, and the end-to-end test case is associated with the end-to-end test script in the corresponding Git branch. The test case execution module selects the test version and executes the end-to-end test case in the test version. The test report management module generates a test report for the test case.
[0107] In a specific embodiment, Figure 4 A specific flow chart of another end-to-end testing method of Serverless Kubernetes according to an embodiment of the present disclosure is shown, and the figure includes the following steps:
[0108] Step S401, creating a Serverless Kubernetes end-to-end test project;
[0109] Step S402, creating a test version in the test project;
[0110] Step S403, designing end-to-end test cases in the test version;
[0111] Step S404, developing an end-to-end test script in the test version;
[0112] Step S405, associating the end-to-end test case with the end-to-end test script;
[0113] Step S406, executing end-to-end test cases;
[0114] Step S407: Generate a test report.
[0115] In a specific embodiment, Figure 5 A schematic diagram of a test project creation process of an end-to-end test method for Serverless Kubernetes according to an embodiment of the present disclosure is shown, and the figure includes the following steps:
[0116] Step S501, whether the test project has been created; if so, go to step S503, if not, go to step S502;
[0117] Here, the test case management module determines whether there is a Serverless Kubernetes test project;
[0118] Step S502, creating a test project;
[0119] Here, the test case management module creates a test project when it is determined that there is no Serverless Kubernetes test project.
[0120] Step S503, determine whether the test project has been bound to the Git repository, if so, end the process, if not, proceed to step S504;
[0121] Step S504, determine whether the Git repository exists, if yes, proceed to step S506, if no, proceed to step S505;
[0122] Step S505, initializing the Git repository and binding it with the test project;
[0123] Here, the test case management module initializes a new Git repository and binds the Git repository to the test project;
[0124] Step S506, binding the Git repository with the test project.
[0125] In a specific embodiment, Figure 6 A schematic diagram of a test version creation process of an end-to-end test method for Serverless Kubernetes according to an embodiment of the present disclosure is shown, and the figure includes the following steps:
[0126] Step S601, determine whether the test version has been created, if so, proceed to step S602, if not, proceed to step S603;
[0127] Here, the test case management module determines whether a test version has been created in the test project;
[0128] Step S602, selecting a created test version;
[0129] Step S603, creating a test version;
[0130] Step S604, determine whether the test version has been bound to the Git branch, if so, end the process, if not, proceed to step S605;
[0131] Step S605, determine whether there is a Git branch, if so, proceed to step S607, if not, proceed to step S606;
[0132] Step S606, initializing the Git branch and binding the test version;
[0133] Step S607, binding the Git branch to the test version.
[0134] In a specific embodiment, Figure 7A schematic diagram of the test case and test script association process of an end-to-end testing method for Serverless Kubernetes in an embodiment of the present disclosure is shown, and the figure includes the following steps:
[0135] Step S701, determine whether the end-to-end test script has been bound; if so, end the process; if not, proceed to step S702;
[0136] Here, the test case management module determines whether the end-to-end test case has been bound to the end-to-end test script;
[0137] Step S702, determine whether there is an end-to-end test script, if so, proceed to step S704, if not, proceed to step S703;
[0138] Step S703, creating an end-to-end test script and binding an end-to-end test case;
[0139] Step S704: Bind the end-to-end test script to the end-to-end test case.
[0140] In one embodiment, a test system 80 is provided, which corresponds one-to-one to the end-to-end test method of Serverless Kubernetes in the above embodiment. Figure 8 As shown, the test system 80 includes a test case management module 801, a test case execution module 802 and a test report management module 803, wherein each functional module is described in detail as follows:
[0141] A test case management module 801 is used to create a test project corresponding to a test object and at least one test version in the test project, and determine an end-to-end test case and an end-to-end test script for each test version in at least one test version;
[0142] The test case execution module 802 is used to execute the end-to-end test script corresponding to the end-to-end test case in each test version and generate a test report for the end-to-end test case;
[0143] The test report management module 803 is used to manage the life cycle of the test report and provide the test report information to the tester.
[0144] In one embodiment, the test case management module 801 is used to determine whether a Serverless Kubernetes end-to-end test project of the test object has been created, and when it is determined that the end-to-end test project has not been created, create the end-to-end test project;
[0145] When it is determined that the end-to-end test project has been created, it is determined whether the end-to-end test project has been bound to a Git repository; when it is determined that the end-to-end test project is not bound to the Git repository, the end-to-end test project is bound to the Git repository.
[0146] In one embodiment, the test case management module 801 is used to determine whether a test version already exists in the end-to-end test project, and when it is determined that no test version exists in the end-to-end test project, create at least one test version in the end-to-end test project;
[0147] Determine whether each test version in the at least one test version is bound to a corresponding Git test project branch. When it is determined that each test version is not bound to the Git test project branch, initialize the Git repository and bind the corresponding Git test project branch to each test version.
[0148] In one embodiment, the test case management module 801 is used to generate an end-to-end test case for each test version based on an end-to-end test case template, wherein the end-to-end test case template includes at least one of the following: a function to be tested, a scenario to be tested in the function to be tested, and a test case in the scenario to be tested;
[0149] An end-to-end test script for each test version is generated based on an end-to-end test script template, wherein the end-to-end test script template includes at least one of the following: the function to be tested, the scenario to be tested, and specific test steps.
[0150] In one embodiment, the test case management module 801 is further used to determine whether the end-to-end test case of each test version in at least one test version is bound to the end-to-end test script, and when it is determined that the end-to-end test case is not bound to the end-to-end test script, determine whether there is an end-to-end test script in the test version;
[0151] When it is determined that the end-to-end test script does not exist in the test version, the end-to-end test script is generated based on an end-to-end test script template, and the end-to-end test script is bound to the end-to-end test case.
[0152] In one embodiment, the test case execution module 802 is used to select a test version of a test object and an end-to-end test case in the test version;
[0153] Executing at least one end-to-end test script in the end-to-end test case, and when the end-to-end test script of the end-to-end test case fails to execute, sending execution failure information to the tester based on a preset notification method;
[0154] After the end-to-end test script of the end-to-end test case is executed, a test report of the end-to-end test case is generated.
[0155] In one embodiment, the test case execution module 802 is further configured to improve the end-to-end test case and the end-to-end test script in the end-to-end test case according to feedback information in the test report of the end-to-end test case.
[0156] It should be noted that: the test system provided in the above embodiment only uses the division of the above program modules as an example to implement the corresponding Serverless Kubernetes end-to-end test method. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the above system can be divided into different program modules to complete all or part of the above-described processing. Figure 1b The embodiments of the method shown belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0157] The present disclosure also provides a computer device having the above Figure 8 The test system shown.
[0158] See also Figure 8 , Fig. 9 is a schematic diagram of the structure of another test system provided by an embodiment of the present disclosure, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0159] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0160] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0161] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0162] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0163] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0164] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0165] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0166] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0167] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0168] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for end-to-end testing of Serverless Kubernetes, characterized in that: Applied to a test system, the test system includes: a test case management module, a test case execution module and a test report management module, the method includes: The test case management module creates a test project corresponding to the test object and at least one test version in the test project, and determines an end-to-end test case and an end-to-end test script for each test version in the at least one test version; The test case execution module executes the end-to-end test script corresponding to the end-to-end test case in each test version, and generates a test report for the end-to-end test case; The test report management module manages the life cycle of the test report and provides the tester with information of the test report.
2. The method according to claim 1, characterized in that The test case management module creates test items corresponding to the test objects, including: A test case management module determines whether a Serverless Kubernetes end-to-end test project of a test object has been created, and when it is determined that the end-to-end test project has not been created, creates the end-to-end test project; The test case management module, when determining that the end-to-end test project has been created, determines whether the end-to-end test project has been bound to a Git repository; when determining that the end-to-end test project is not bound to the Git repository, binds the end-to-end test project to the Git repository.
3. The method according to claim 2, characterized in that The test case management module creates at least one test version in the test project, based on the following steps: A test case management module, which determines whether a test version already exists in the end-to-end test project, and when it is determined that no test version exists in the end-to-end test project, creates at least one test version in the end-to-end test project; The test case management module determines whether each test version in the at least one test version is bound to a corresponding Git test project branch. When it is determined that each test version is not bound to the Git test project branch, the Git repository is initialized to bind the corresponding Git test project branch to each test version.
4. The method according to claim 3, characterized in that The test case management module determines the end-to-end test cases and end-to-end test scripts of each test version in the at least one test version, based on the following steps: A test case management module generates an end-to-end test case for each test version based on an end-to-end test case template, wherein the end-to-end test case template includes at least one of the following: a function to be tested, a scenario to be tested in the function to be tested, and a test case in the scenario to be tested; The test case management module generates an end-to-end test script for each test version based on an end-to-end test script template, wherein the end-to-end test script template includes at least one of the following: the function to be tested, the scenario to be tested and specific test steps.
5. The method according to claim 4, characterized in that The method further comprises: a test case management module, determining whether an end-to-end test case of each test version in at least one test version is bound to an end-to-end test script, and when it is determined that the end-to-end test case is not bound to the end-to-end test script, determining whether an end-to-end test script exists in the test version; When it is determined that the end-to-end test script does not exist in the test version, the test case management module generates the end-to-end test script based on an end-to-end test script template and binds the end-to-end test script to the end-to-end test case.
6. The method according to claim 5, characterized in that The test case execution module executes the end-to-end test script corresponding to the end-to-end test case in each test version and generates a test report for the end-to-end test case, which is implemented based on the following steps: A test case execution module selects a test version of a test object and an end-to-end test case in the test version; The test case execution module executes at least one end-to-end test script in the end-to-end test case, and when the end-to-end test script of the end-to-end test case fails to execute, sends execution failure information to the tester based on a preset notification method; The test case execution module generates a test report of the end-to-end test case after the end-to-end test script of the end-to-end test case is executed.
7. The method according to claim 6, characterized in that The method further comprises: The test case execution module improves the end-to-end test case and the end-to-end test script in the end-to-end test case according to feedback information in the test report of the end-to-end test case.
8. A testing system, characterized in that: The test system includes a test case management module, a test case execution module and a test report management module, wherein: The test case management module is used to create a test project corresponding to the test object and at least one test version in the test project, and determine an end-to-end test case and an end-to-end test script for each test version in the at least one test version; The test case execution module is used to execute the end-to-end test script corresponding to the end-to-end test case in each test version, and generate a test report for the end-to-end test case; The test report management module is used to manage the life cycle of the test report and provide the tester with information of the test report.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the end-to-end testing method of Serverless Kubernetes described in claims 1-7.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the end-to-end testing method of Serverless Kubernetes described in any one of claims 1 to 7.