Test method, component update method, and processing system

By loading test tasks into the test environment when associated components are not updated, the problem of invalid waiting in traditional testing methods is solved, and efficient concurrent execution of component construction verification tests is achieved.

CN115309626BActive Publication Date: 2026-11-24BEIJING ESWIN COMPUTING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210161906.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-22
Publication Date
2026-11-24
Estimated Expiration
2042-02-22

AI Technical Summary

Technical Problem

In traditional testing methods, due to the impact of compilation time and dependencies, there are invalid waits during the component building and verification testing process, resulting in low testing efficiency and hindering concurrent execution.

Method used

If the associated components of the target component are not in an update process, load them into the test environment to execute test tasks, and manage the state of the component by using a tag file and a locking semaphore to allow different test tasks to be executed concurrently.

Benefits of technology

It reduces unnecessary waiting between test tasks, improves testing efficiency and environment utilization, and saves testing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0003515139340000011
    Figure HDA0003515139340000011
  • Figure HDA0003515139340000021
    Figure HDA0003515139340000021
  • Figure HDA0003515139340000031
    Figure HDA0003515139340000031
Patent Text Reader

Abstract

This disclosure provides a testing method, a component update method, a processing system, and a computer-readable storage medium. The testing method includes: loading a target component into a first testing environment; identifying at least one associated component that has a dependency on the target component; determining whether each associated component is in an update process; if the associated component is not in an update process, copying the associated component to the first testing environment; and in the first testing environment, executing test tasks on the target component based on all associated components of the target component. According to various embodiments of the present invention, the test tasks of the target component can be executed even when the associated components that have a dependency on the target component are not in an update process, without waiting for the update processes of other components that do not have a dependency to finish. This allows different test tasks to be executed concurrently, reducing unnecessary waiting between different test tasks, saving test time, and improving test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more specifically, to a testing method, a component updating method, a processing system, and a computer-readable storage medium. Background Technology

[0002] In the field of computer technology, Build Verification Test (BVT) refers to a test run after a version build is completed to verify the basic functions of the system. If the build verification test is successfully passed, it means that the current build version is testable and the basic functions can be run. Technicians can then conduct further in-depth testing on the current build version.

[0003] In the software development process, if a project involves multiple components, after developers complete the daily coding and debugging of a certain component, they usually need to perform build verification tests on that component.

[0004] However, in traditional testing methods, due to the influence of compilation time and dependencies, there are invalid waits during the testing process, resulting in low testing efficiency and making it difficult to execute the construction and verification tests of various components concurrently. Summary of the Invention

[0005] To address the problems existing in the prior art, the present invention provides a testing method, a component update method, a processing system, and a computer-readable storage medium. According to various embodiments of the present invention, the testing task of the target component can be executed even when the related components that have a dependency on the target component are not in the update process, without waiting for the update process of other undependent components to finish. This allows different testing tasks to be executed concurrently, reducing unnecessary waiting between different testing tasks, saving testing time, and improving testing efficiency.

[0006] According to one aspect of the present invention, a testing method is provided, comprising: loading a target component into a first testing environment; determining at least one associated component that has a dependency relationship with the target component; determining whether each of the associated components of the target component is in an update process, and if the associated component is not in an update process, copying the associated component to the first testing environment; and performing a test task on the target component based on the at least one associated component in the first testing environment.

[0007] In some optional embodiments, the test task includes build verification testing and / or smoke testing of the target component, and the test method executes at least one of the test tasks concurrently.

[0008] In some optional embodiments, the step of determining whether each of the associated components of the target component is in an update process, and copying the associated component to the first test environment if the associated component is not in an update process, includes: traversal judgment to determine whether there are any associated components that have a dependency relationship with the target component but have not been copied to the first test environment; update confirmation to confirm whether the associated component to be copied is in an update process if the associated component exists, and if so, wait and copy the associated component to be copied to the first test environment after the update process of the associated component to be copied is completed, and if not, copy the associated component to be copied to the first test environment; repeating the traversal judgment and update confirmation steps until at least one associated component that has a dependency relationship with the target component has been copied to the first test environment.

[0009] In some optional embodiments, the update confirmation step includes: searching in a first tag file to confirm that the associated component to be copied is in the update process if the first tag file has marked the associated component to be copied as being in an update state.

[0010] In some optional embodiments, the step of copying the associated component to be copied to the first test environment includes: locking the associated component to be copied; copying the currently locked version of the associated component to be copied to the first test environment so that the test task can be executed based on the currently locked version of the associated component to be copied; and unlocking the test task from the associated component to be copied.

[0011] In some optional embodiments, the step of locking the associated component to be copied includes: writing a lock semaphore of the associated component to be copied into a second tag file, the lock semaphore pointing to the currently locked version of the associated component to be copied, and the lock semaphore indicating that the currently locked version of the associated component to be copied cannot be modified; and the step of unlocking the component to be copied by the test task includes: clearing the lock semaphore corresponding to the test task in the second tag file.

[0012] In some optional embodiments, the locking semaphore includes a tag corresponding to the component to be copied and a signature, the signature being used to distinguish locking semaphores configured for the same component by different test tasks.

[0013] In some alternative embodiments, the tag includes at least a portion of the component name of the component to be copied; and / or the signature includes a timestamp.

[0014] In some optional embodiments, the step of determining at least one associated component that has a dependency relationship with the target component includes: searching for an entry corresponding to the target component in a dependency table; and determining the at least one associated component based on the entry.

[0015] According to a second aspect of the present invention, a component update method is provided, comprising: performing a test task on a target component based on the test method described above; and, if the target component successfully passes the test task, updating a component to be updated corresponding to the target component according to the target component, wherein, if the target component successfully passes the test task, the step of updating the component to be updated according to the target component includes: confirming whether the component to be updated is in a locked state; if so, waiting and executing an update process after the component to be updated is unlocked; if not, executing the update process, wherein the update process is a process of updating the component to be updated based on the target component.

[0016] In some optional embodiments, the step of confirming whether the component to be updated is in a locked state includes: searching in a second tag file to confirm that the component to be updated is in a locked state if the second tag file contains a lock semaphore corresponding to the component to be updated.

[0017] In some optional embodiments, the update process includes: configuring the component to be updated to an update state to indicate that the component to be updated is in the update process; updating the code of the component to be updated according to the target component; and configuring the component to be updated to a non-update state after updating the code of the component to be updated.

[0018] In some optional embodiments, the step of updating the component to be updated according to the target component includes: compiling the target component and replacing the component to be updated with the compiled executable file.

[0019] In some optional embodiments, the step of configuring the component to be updated to an update state includes: writing an update semaphore of the component to be updated into a first tag file, the update semaphore being used to indicate that the component to be updated is currently in the update process and cannot be copied; and the step of configuring the component to be updated to a non-update state includes: clearing the update semaphore corresponding to the update process in the first tag file.

[0020] In some alternative embodiments, the update semaphore includes a tag corresponding to the component to be updated, the tag including at least a portion of the component name of the component to be updated.

[0021] In some optional embodiments, the update semaphore includes a tag and / or marker code corresponding to the component to be updated, the marker code being used to indicate the time order of versions of multiple update tasks to be performed on the target component, so that the update process is executed based on the version of the target component with the latest order.

[0022] In some optional embodiments, the component update method further includes: if the target component successfully passes the test task, merging the target component into the official branch of the project, and then loading the target component from the official branch into a second test environment, so that the target component loaded into the second test environment can be used to update the component to be updated stored in the storage device.

[0023] According to a third aspect of the present invention, a processing system is provided, comprising: a processor for executing a scheduling toolkit; and a storage device for storing a plurality of verified components, wherein the scheduling toolkit is configured to: load the target component into a first test environment; determine at least one associated component among the plurality of verified components that has a dependency relationship with the target component; and determine whether each of the associated components of the target component is in an update process, and if the associated component is not in an update process, copy the associated component to the first test environment, such that the processor performs a test task on the target component in the first test environment based on the at least one associated component copied to the first test environment.

[0024] In some optional embodiments, the test task includes build verification testing and / or smoke testing of the target component, and the processor concurrently executes at least one of the test tasks based on the scheduling toolkit.

[0025] In some alternative embodiments, after the target component is merged into a temporary branch of the project, the scheduling toolkit automatically loads the target component from the temporary branch into the first test environment and copies the associated component that is not in an update process to the first test environment.

[0026] In some optional embodiments, after the target component successfully passes the test task and is merged into the official branch of the project, the scheduling toolkit loads the target component from the official branch into the second test environment and updates the verified component in the storage device that corresponds to the target component and is not in a locked state based on the target component.

[0027] In some alternative embodiments, the verified components stored in the storage device are compiled executable files.

[0028] In some alternative embodiments, the storage device further stores a dependency table, and the scheduling toolkit is configured to read entries in the dependency table corresponding to the target component in order to determine the at least one associated component that has a dependency on the target component.

[0029] In some optional embodiments, the storage device further stores a first tag file, and the scheduling toolkit is configured to: perform a read operation on the first tag file to confirm whether each of the associated components is marked as updated by the first tag file before performing the test task on the target component; perform a write operation on the first tag file to write an update semaphore of the verified component to mark the verified component as updated if it is necessary to update one of the verified components in the storage device, and clear the update semaphore after the verified component is updated to mark the verified component as non-updated.

[0030] In some optional embodiments, the storage device further stores a second tag file, and the scheduling toolkit is configured to: perform a read operation on the second tag file to confirm whether a verified component is marked as locked by the second tag file before updating one of the plurality of verified components in the storage device; and perform a write operation on the second tag file to write a lock semaphore of the verified component to mark the verified component as locked if the test task needs to copy one of the verified components in the storage device to the first test environment, and clear the lock semaphore after the verified component has been copied to release the lock of the verified component by the test task.

[0031] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having instructions stored thereon, wherein the instructions are executed by one or more processing units to implement the testing method and / or component update method as described above. Attached Figure Description

[0032] The above and other objects, features and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings.

[0033] Figure 1 This diagram illustrates the structure of a processing system according to an embodiment of the present disclosure.

[0034] Figure 2 A schematic diagram illustrating the principle of the scheduling toolkit according to an embodiment of this disclosure is shown;

[0035] Figure 3 A flowchart illustrating the testing method provided in an embodiment of this disclosure is shown.

[0036] Figure 4 A flowchart illustrating a component update method according to an embodiment of this disclosure is shown. Detailed Implementation

[0037] The present invention is described below based on embodiments, and many specific details of the invention are described in the hereinafter to provide a clearer understanding of the invention. However, as those skilled in the art will understand, the invention may be implemented without following these specific details, i.e., the invention is not limited to these embodiments. To avoid obscuring the essence of the invention, well-known methods, processes, flows, elements, and circuits are not described in detail.

[0038] In the various figures, the same elements are represented by similar reference numerals. Furthermore, those skilled in the art should understand that the figures provided herein are for illustrative purposes only and are not necessarily drawn to scale.

[0039] Before introducing exemplary embodiments of this application, the terms used in this application will be explained in order to help those skilled in the art to better understand this application.

[0040] A build is a version generated after any modifications are made to the project's source code and it is recompiled. Builds may be generated during the debugging, optimization, updating, and testing phases before or after the project is released.

[0041] Build Verification Test (BVT) is a test run after a build is completed to verify the basic functionality of the system. Successfully passing the BVT indicates that the current build is testable and its basic functions are functional, allowing engineers to conduct further in-depth testing. Broadly speaking, BVT can be any test task performed automatically or manually on the software. Based on the number and complexity of the tested functions, BVT can be divided into Simple Version Verification Test (SBVT) and Full Version Verification Test (FBVT).

[0042] Smoke testing is the process by which technical personnel verify code changes before embedding them into the project's source tree. It's a cost-effective method for identifying and fixing software defects. Smoke testing can be performed at different stages of software development. For example, it can be performed before the integration test version to verify that individual components can function successfully; components that pass the smoke test can be merged into the integration test version. It can also be performed after the integration test version is created to ensure that new or modified components do not compromise the integrity and stability of the integration test version; components that pass the smoke test can be used to update the integration test version. Furthermore, it can be performed in the later pre-testing stage to test each component that has been fixed due to defects in a clean linking environment; components that pass the smoke test can be used to update the relevant software version.

[0043] Since the purpose and execution phase of smoke testing are largely the same as those of build verification testing—both aim to verify the basic functions of the system to quickly determine whether the program's basic functions work correctly—smoke testing is often equated with build verification testing in some scenarios. In other scenarios, smoke testing can also be a test task based on a set of functional test cases integrated within the build verification test (BVT). That is, the BVT can include smoke testing as well as other tests, such as full verification and regression verification.

[0044] This disclosure does not distinguish between "build verification test" and "smoke test". In the description of the embodiments of this disclosure, the test task includes build verification test and / or smoke test, and may also include other similar tests.

[0045] Testing Environment: refers to the collective hardware, software, network, tools and / or data necessary to complete a testing task, which may include virtual machines, container clusters, physical devices, etc.

[0046] Components: These are components created after engineers develop or modify component code. In some embodiments, engineers may merge the code of newly developed or modified components during project iterations into temporary branches of the project. These components in temporary branches, as part of the current build version of the project, need to pass build verification tests and / or smoke tests before they can be merged into the project's official branch.

[0047] In software development, if a project involves multiple components, developers typically need to perform build and verification tests on that component after completing routine coding and debugging. Based on traditional testing methods, if component X needs updating during testing, component X must be updated in every test environment. This means that even if component X has no dependency on the component under test, the test environment used to test the current component must wait until component X is updated before further testing can proceed. This results in inefficient waiting during the build and verification testing process of the component under test, leading to low efficiency in test environment utilization.

[0048] Therefore, in traditional testing methods, due to the influence of compilation time and dependencies, there are invalid waits during the testing process, resulting in low testing efficiency and making it difficult to execute the construction and verification tests of various components concurrently.

[0049] According to the testing scheme provided in the embodiments of this disclosure, the test task of the target component can be executed when the related components that have a dependency relationship with the target component are not in the update process, without having to wait for the update process of other components that do not have a dependency relationship to finish. This allows different test tasks to be executed concurrently, reduces invalid waiting between different test tasks, saves test time, and improves test efficiency and the utilization efficiency of the test environment.

[0050] Hereinafter, some embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0051] Figure 1 A schematic diagram of the structure of the processing system according to an embodiment of the present disclosure is shown.

[0052] like Figure 1 As shown, the processing system 1000 mainly includes a storage device 100 and a processor 200 for performing test tasks (including building verification tests and / or smoke tests, etc.) on the target component to be verified.

[0053] The processing system 1000 also provides a test environment 500, which provides software and / or hardware support for performing tasks such as testing and / or updating. The specific implementation of the test environment is not limited in the embodiments of this disclosure. In the description of some embodiments of this disclosure, the test environment 500 includes a first test environment 510 and a second test environment 520 (e.g., ...). Figure 2 As shown, the first test environment 510 is a smoke environment, and the second test environment 520 is a compilation environment, for example. However, it should be noted that the first test environment 510 and the second test environment 520 can be the same test environment, or they can be separate or isolated test environments. This disclosure does not limit the configuration of specific test environments.

[0054] The processing system 1000 may also include a code repository 300 for storing code generated during project iteration (e.g., including multiple formal branches and multiple temporary branches). The code repository 300 may be stored, for example, in whole or in part, on a local server, a remote server, and / or a storage device 100. This disclosure does not limit the specific hardware implementation of the code repository 300.

[0055] Storage device 100, such as a storage array or shared directory, is used to store multiple components 10. This disclosure does not limit the hardware implementation of storage device 100. The multiple components 10 stored in storage device 100 include at least multiple verified components that have successfully passed build verification tests and / or smoke tests, for use in copying to test environment 500 during test task execution. If components need to be modified or added, the components 10 stored in the storage device can be updated by executing update tasks.

[0056] In some embodiments, the storage device may also store a dependency table 20 between components. The dependency table 20 includes multiple entries, each corresponding to a specific component in the project, and indicates the associated components that have a dependency relationship with that component. Based on this, the processor 200 can determine the associated components that have a dependency relationship with the target component by searching in the dependency table 20, so that the test task of the target component can be executed based on the associated components that have a dependency relationship with the target component.

[0057] For example, such as Figure 1 and 2 As shown, component K0 has dependencies on components K1 to Kq. Therefore, when executing a test task on component K0 (the target component), components K1 to Kq are associated components of the target component K0. The processor 200 needs to determine, based on the dependency table, that the associated components K1 to Kq depend on the target component K0, and copy each associated component K1 to Kq to the test environment 500 to facilitate the execution of test task K. Each test task can be executed concurrently. Here, q is a natural number greater than or equal to 1.

[0058] As an example, dependency table 20 may include N entries (or N rows), each corresponding to one of the N components included in the project. Each entry includes a label for the corresponding component (e.g., the component name of the corresponding component) and labels for each associated component that has a dependency relationship with the corresponding component (e.g., the component names of each associated component). Here, N is a natural number greater than or equal to 1. In some examples, N may be equal to the total number of components included in the project.

[0059] In some embodiments, the storage device 100 may also store at least one tag file 30 for tagging the lock status and / or update status of each component 10 stored in the storage device 100, to indicate whether the corresponding component 10 can be copied to the test environment 500, and / or to indicate whether the corresponding component 10 can be updated.

[0060] As an example, the storage device 100 may store a first tag file 31 to indicate which components are currently in an update state. For instance, before a component in the storage device 100 begins its update process, the update semaphore of that component (e.g., including the component name or other tags used to identify the component) can be written into the first tag file. The update semaphore is used to indicate that the component is currently in an update state and cannot be copied or moved; and when the update process of that component ends, the update semaphore of that component can be cleared from the first tag file.

[0061] Based on this, by reading the first marker file 31, it can be determined whether the component that needs to be operated on (e.g., copy operation) is in the update process. If so, the current operation needs to wait until the update process ends to avoid interfering with the update or making the operation invalid.

[0062] However, the embodiments of the present invention are not limited to this. For example, the first tag file 31 may also include tags for each component (e.g., component names or other tags used to specify the component) and update flag bits corresponding to each tag. That is, the first tag file 31 can record whether each component is in the update process by marking the update status. This disclosure does not limit the way the first tag file records the update status of each component.

[0063] As an example, the storage device 100 may also store a second tag file 32 for indicating which components are currently locked. For instance, before a component in the storage device 100 is copied to the test environment 500, a lock semaphore for that component can be written to the second tag file 32. The lock semaphore indicates that the component is currently locked and cannot be updated or modified. It may include a tag corresponding to the component (e.g., including at least part of the component name) and a feature code (used to distinguish lock semaphores configured for the same component by different test tasks, such as including a millisecond-level timestamp). Furthermore, when the component is unlocked (returns to an unlocked state), the lock semaphore for that component can be cleared from the second tag file. The steps of "writing lock semaphores," "copying components," and "clearing lock semaphores" described above can be executed serially by the processor 200.

[0064] Based on this, by reading the second marker file 32, it can be determined whether the component that needs to be operated on (e.g., update operation) is in a locked state. If so, the current operation needs to wait until the component is unlocked in order to avoid operation failure or process interference.

[0065] Because the locking semaphore contains a signature (which has a certain degree of uniqueness), different test tasks can concurrently request to copy the same component from the storage device to the test environment. The component corresponds to multiple locking semaphores with different signatures. The first copy operation to finish clears the corresponding locking semaphore without affecting the locking semaphore corresponding to the copy operation that finishes later. This ensures that the copied component will not be modified in subsequent copy operations. Thus, the processing system of this embodiment allows multiple test tasks to be executed concurrently.

[0066] Processor 200 executes scheduling toolkit 210, which is configured to: load the target component to be verified into test environment 500; identify at least one associated component among the plurality of components 10 in storage device 100 that has a dependency on the target component; and determine whether each associated component of the target component is in an update process. If the associated component is not in an update process, the associated component is copied to test environment 500, so that processor 200 performs a test task on the target component in test environment 500 based on all associated components that have a dependency on the target component copied to test environment 500. Furthermore, in some embodiments, based on the verification results of the test task, processor 200 can update the corresponding component in storage device 100 (e.g., a prior version of the target component) according to the target component that successfully passes the test.

[0067] In the various embodiments of this disclosure, the scheduling toolkit 210 can copy each associated component to the test environment when it determines that the associated components of the target component are not in the update process, so that the processor 200 can execute the corresponding test tasks on the target component. Other test tasks that do not involve these associated components do not need to wait until the update process of these associated components ends. Therefore, the processor 200 can realize the concurrent execution of different test tasks based on the scheduling toolkit 210.

[0068] Figure 2 A schematic diagram illustrating the principle of the scheduling toolkit according to an embodiment of this disclosure is shown below. Reference will be made below. Figure 1 and 2 Further describe the relevant configuration of the processing system 1000.

[0069] After the technical staff completes the development or modification of the component, the component can be automatically or manually merged into the temporary branch of the code repository 300. The scheduling toolkit 210 can automatically or manually start the test task of the component under this trigger, and first load the component to be tested from the temporary branch into the first test environment 510 for executing the test task based on the code management tool (such as Gerrit, GitLab, etc.).

[0070] like Figure 1 and 2 As shown, the target component to be tested is, for example, component A0. The scheduling toolkit 210 automatically or manually loads the target component A0 from the temporary branch into the first test environment 510, and uses the dependency table on the storage device 100 to identify components A1 to Ap that have dependencies on component A0, so as to determine that components A1 to Ap are associated components of the target component A0. Here, p is a natural number greater than or equal to 1.

[0071] Subsequently, the scheduling toolkit 210 determines whether each associated component of the target component is in the update process. In some embodiments, the scheduling toolkit 210 can perform a read operation on the first tag file 31 to confirm whether each associated component A1 to Ap is marked as updated by the first tag file 31 before performing a test task on the target component A0.

[0072] by Figure 1 and 2 For example, if the associated component A1 of the target component A0 is marked as updated by the first tag file 31, the scheduling toolkit 210 needs to wait for the update process of component A1 to finish before copying component A1 to the first test environment 510; if component A1 is not marked as updated by the first tag file 31, the scheduling toolkit 210 writes the locking semaphore of component A1 (e.g., A1 + signature a1) into the second tag file 32 to indicate that component A1 cannot be updated or modified at present, and then copies component A1 stored in the storage device 100 to the first test environment 510. After the copy is completed, the locking semaphore (A1 + signature a1) in the second tag file 32 is cleared to release the lock on the associated component.

[0073] Repeat the above steps to traverse the associated components A1 to Ap of the target component A0, so that components A1 to Ap are copied to the first test environment 510, so that the processor 200 can perform test tasks such as build verification test and / or smoke test on the target component A0 based on the components A1 to Ap copied to the first test environment 510.

[0074] Since the locking semaphores written to the second tag file 32 by the scheduling toolkit 210 include not only the tags of the corresponding components but also the signatures used to distinguish them from locking semaphores generated by other test tasks, this embodiment of the present disclosure allows for the concurrent execution of different test tasks. For example, if component K1 involved in test task K is the same component as component A1, the locking semaphore generated by the scheduling toolkit 210 for component K1 (e.g., A1 + signature a2) will not be exactly the same as the locking semaphore generated by the scheduling toolkit 210 for component A1 (e.g., A1 + signature a1). Therefore, the scheduling toolkit 210 allows the synchronous copying of component A1 from the storage device to the runtime environment of test task K and the test environment of test task A without unnecessary queuing. Furthermore, since the locking semaphores are written and cleared independently for different test tasks, the start and end of different copy operations do not affect each other, improving test efficiency and saving test time.

[0075] After the target component successfully passes the build verification test and / or smoke test, the target component can be merged into the project's official branch. Subsequently, the processor 200 can automatically perform update tasks on the corresponding components in the storage device 100 based on the target component by executing the scheduling toolkit 210, and first load the target component from the official branch into the second test environment 520.

[0076] In an update task, the scheduling toolkit 210 can first determine whether the target component is locked. In some embodiments, the scheduling toolkit 210 can perform a read operation on the second marker file 32 to determine whether the target component is locked by other processes (e.g., a copy process initiated by a test task) before performing an update task on the target component.

[0077] by Figure 1 and 2 For example, if target component A0 is marked as locked by the second tag file 32, the scheduling toolkit 210 needs to wait for component A0 to be unlocked before updating component A0 in the storage device 100; if component A0 is not marked as locked by the second tag file 32, the scheduling toolkit 210 writes the update semaphore of component A0 (e.g., component name or other tag used to indicate component A0) into the first tag file 31 to indicate that component A0 is currently occupied by the update process, and after the update is completed, it clears the update semaphore (component tag A0 + tag code a0) in the first tag file 31 to restore the non-updating state of component A0.

[0078] In some embodiments, the update semaphore may further include a tag code. The tag code enables the aggregation of update tasks. The tag code indicates the time order of multiple target components to be updated, for example, indicating an update sequence number (e.g., fef681b0, 17d50204, etc.). Each component commit corresponds to an update sequence number. Based on this, if multiple versions of target component A0 are merged into the official branch and need to be updated on storage device 100, the scheduling toolkit 210 writes the corresponding update semaphore (e.g., component tag A0 + update sequence number commitID01, component tag A0 + update sequence number commitID02, etc.) to the first tag file 31 for each version of the target component, and identifies the latest update sequence number. Therefore, only the latest version of target component A0 on the official branch (corresponding to the latest update sequence number) needs to be updated to storage device 100, without serially updating multiple versions of target component A0 to storage device 100. This achieves the aggregation of update tasks, saves hardware and software resources, and improves update efficiency.

[0079] The processing system 1000 of this disclosure embodiment can flexibly realize automated testing and component updates. By executing the scheduling toolkit 210, it can automatically and efficiently execute automated testing tasks of multiple components and supports distributed and high-concurrency automated testing tasks.

[0080] The testing method implemented by the processing system 1000 of this disclosure will be further described in the following embodiments. However, it should be noted that the testing method and component update method provided in this disclosure do not necessarily depend on the hardware implementation provided in the above embodiments.

[0081] Figure 3 A flowchart illustrating the testing method provided in an embodiment of this disclosure is shown. Figure 3 As shown, the testing method of this embodiment includes steps S310 to S390.

[0082] In step S310, a test task for the target component is initiated. The test task includes building verification tests and / or, in other words, smoke tests. In some embodiments, the test task for the target component may be initiated automatically after a technician has completed the development or modification of the component. In some embodiments, the test task for the target component may also be initiated manually by a technician.

[0083] In step S320, the target component is loaded into the first test environment. In some embodiments, the target component can be downloaded from a temporary branch of the project to the first test environment. In some specific examples, a code management tool (such as GitLab, Gerrit, etc.) can be used to download the code of the target component from a temporary branch in a local or remote code repository to the first test environment. In some embodiments, the target component can also be directly committed to the first test environment by the developer.

[0084] In step S330, associated components that have a dependency relationship with the target component are identified. In some embodiments, each associated component that has a dependency relationship with the target component can be identified by looking up a dependency table. The dependency table is used to indicate the dependencies between components in the project, and the testing task of the target component is implemented based on each component that has a dependency relationship with the target component.

[0085] In step S340, it is confirmed whether there are still any related components that have dependencies on the target component but have not been copied to the first test environment (confirm whether the related components have been traversed). If yes, proceed to step S350; if no, proceed to step S390.

[0086] In step S350, it is determined whether the associated component to be copied is in an update process. If the associated component to be copied is in an update process, the current test task needs to wait (i.e., execute step S360) until the associated component to be copied is no longer in any update process; if the associated component to be copied is not in an update process, the current version of the associated component to be copied can be locked (i.e., execute step S370), so that the current test task can be executed based on the associated component to be copied locked by the current test task.

[0087] In some embodiments, a first tag file can be used to confirm whether the associated component to be copied is in an update process.

[0088] In some examples, the first tag file is used, for instance, to indicate which components are currently in an update process. For example, before a component to be updated begins its update process, its update semaphore (e.g., including the component name or other tags specifying the component) can be written to the first tag file; and when the update process of that component ends, its update semaphore can be removed from the first tag file. Based on this example, in step S350, which confirms whether the associated component to be copied is in an update process, the update semaphore corresponding to the associated component to be copied can be searched in the first tag file. If the first tag file contains an update semaphore corresponding to the associated component to be copied, it can be determined that the associated component to be copied is in an update process, and the current test task needs to wait; otherwise, if the first tag file does not contain an update semaphore corresponding to the associated component to be copied, it can be determined that the associated component to be copied is not in an update process.

[0089] In some embodiments, the update semaphore may also include a tag code, which, for example, indicates an update sequence number. The aggregation of update tasks can be achieved based on the tag code, which will not be elaborated further here.

[0090] However, the embodiments of the present invention are not limited to this. For example, the first tag file may also include labels for each component (e.g., component names or other labels used to specify the component) and update flags corresponding to each label. That is, the first tag file can record whether each component is in the update process by marking the update status. For example, before the update process of a component that needs to be updated begins, the update flag corresponding to the component that needs to be updated can be recorded as an update status; and when the update process ends, the update flag of the label corresponding to the updated component can be reset to a non-update status. Based on this example, in step S350 of confirming whether the associated component to be copied is in the update process, the update flag corresponding to the label of the associated component to be copied can be confirmed in the first tag file. If the update flag indicates an update status, it can be determined that the associated component to be copied is in the update process, and the current test task needs to wait; while if the update flag indicates a non-update status, it can be determined that the associated component to be copied is not in the update process.

[0091] In the waiting step S360, a preset waiting time can be established, and after the waiting time expires, the execution will return to step S350. Based on this, step S350 can be repeatedly executed at preset waiting time intervals, so that after the update process of the associated component to be copied is completed, the current test task can exit the waiting phase and continue execution. It should be noted that the embodiments of this disclosure are not limited to this, and other methods can be used to exit the waiting step S360.

[0092] In step S370, if the associated component to be copied is not in the update process, the current version of the associated component to be copied stored in the storage device is locked, thereby preventing the associated component to be copied stored in the storage device from being updated or modified during the copying process of copying the associated component to be copied from the storage device to the first test environment (i.e., step S380).

[0093] In some embodiments, a second tag file can be used to manage the locking and unlocking of the component. For example, step S370 may write a lock semaphore of the associated component to be copied into the second tag file, which indicates that the current version of the associated component to be copied cannot be updated or modified.

[0094] In some examples, the locking semaphore includes, for example, the component name of the associated component to be copied (used to distinguish it from other locked components) and a signature (e.g., a millisecond-level timestamp). Because the locking semaphore contains a signature uniquely corresponding to the current test task, different test tasks can concurrently request to copy the same component from the storage device to the first test environment, and this component corresponds to different locking semaphores. The locking semaphore of the component required by the first copying process to end is cleared without affecting the locking semaphore of the component required by the subsequent copying process, ensuring that the copied component is not modified in the subsequent copying process. Therefore, the testing method of this disclosure embodiment allows multiple test tasks to be executed concurrently.

[0095] In step S380, the associated component to be copied is copied from the storage device to the first test environment. After the copy is completed, the lock on the associated component to be copied is released (e.g., the lock semaphore of the associated component to be copied corresponding to the test task in the second tag file is cleared), and the process returns to step S340, so that all associated components that have a dependency relationship with the target component can be traversed and steps S350 to S370 are executed. If all lock semaphores corresponding to the associated component to be copied in the second tag file are cleared, modification or updating of the associated component to be copied stored in the storage device is allowed; however, if there is a lock semaphore corresponding to the associated component to be copied in the second tag file, modification or updating of the associated component to be copied stored in the storage device is not allowed.

[0096] In step S390, build verification tests and / or smoke tests are performed in the first test environment based on the target component and all associated components copied to the target component in the first test environment. For example, after copying the associated components to the first test environment, the target component is first compiled. If the compilation is successful, build verification tests and / or smoke tests are performed based on the compiled executable file (e.g., by executing automated test cases). If the target component fails the test task, the technician needs to generate a new version of the target component after fixing the problem, and then initiate a new test task starting from step S310.

[0097] In some embodiments, to simplify the process and save compilation resources, the components stored in the storage device are verified and pre-compiled components. That is, the associated components copied from the storage device to the first test environment can be used directly for the test task without needing to be compiled in the first test environment. Therefore, if the compilation of the target component does not depend on the associated components, step S390 only needs to compile the target component to be tested, and does not need to compile the associated components.

[0098] Figure 4 A flowchart illustrating a component update method according to an embodiment of this disclosure is shown. Figure 4 As shown, the component update method of this disclosure includes steps S510 to S590.

[0099] In step S510, a test task (e.g., including building verification tests and / or smoke tests) is performed on the target component. If the test passes, step S520 is executed; otherwise, step S510 is re-executed after debugging the code of the target component. In some embodiments, performing the test task may include, for example, using the target component as the target component and performing the above steps S310 to S390.

[0100] In step S520, the target component that has successfully passed the test is loaded into the second test environment, and the update task of the target component is started.

[0101] In some embodiments, after completing step S510, the target component that successfully passes the test can be merged into the project's official branch (local or remote code repository), making the target component part of the current build. Based on this example, step S520 can be used to download the target component from the project's official branch to the second test environment. In some specific examples, code management tools (such as GitLab, Gerrit, etc.) can be used to download the code of the target component from the official branch to the second test environment from the local or remote code repository. However, the embodiments of this disclosure are not limited to this; in some embodiments, the target component can also be directly committed to the second test environment after successfully passing the test.

[0102] In some embodiments, the update task for the target component can be initiated automatically after the target component passes testing. In some embodiments, the update task for the target component can also optionally be initiated manually by developers or testers.

[0103] In some embodiments, since the target component downloaded from the official branch is source code that has been successfully verified through build verification tests and / or smoke tests, it can be compiled in a second test environment so that the updated target component in the storage device is the already compiled version. As mentioned above, this can save compilation resources and improve compilation efficiency during the testing process.

[0104] In step S530, it is confirmed whether the component to be updated corresponding to the target component in the storage device is in a locked state. If yes, wait (i.e., execute step S540); if no, continue to execute the update task (i.e., step S550).

[0105] If the component to be updated in the storage device is locked, it means that the component to be updated corresponding to the target component may be in the process of being copied as an associated component of other components, and therefore updating the component to be updated is not allowed; if the component to be updated in the storage device is not locked, updating the component to be updated is allowed.

[0106] In some embodiments, a second tag file can be used to confirm whether the component to be updated corresponding to the target component is in a locked state. For example, it can be determined whether the component to be updated is in a locked state by confirming whether there is a lock semaphore corresponding to the component to be updated in the second tag file. Referring to step S370 of the foregoing embodiment, the locking and unlocking of each component in the storage device can be managed using a second tag file. If the component to be updated corresponding to the target component is in a locked state, at least one lock semaphore of the component to be updated has been written into the second tag file (for example, written by a copy process initiated by one or more concurrent test tasks, and each lock semaphore will be released after the corresponding copy process ends, i.e., cleared from the second tag file), to indicate that the current version of the component to be updated cannot be updated or modified; if the component to be updated corresponding to the target component is not in a locked state, there is no lock semaphore corresponding to the component to be updated in the second tag file.

[0107] In the waiting step S540, a preset waiting time can be established, and after the waiting time expires, the execution will return to step S530. Based on this, step S530 can be repeatedly executed at preset waiting time intervals, so that after the copying process of the component to be updated (or other processes occupying the component to be updated) ends, the current update task can exit the waiting phase and continue execution. It should be noted that the embodiments of this disclosure are not limited to this, and other methods can be used to exit the waiting step S530.

[0108] In step S550, if the component to be updated is not in a locked state, the component to be updated stored in the storage device is configured to be in an updated state to indicate that the component to be updated is in an update process. This prevents other processes from performing other operations (such as copy operations initiated by one or more concurrent test tasks) during the process of updating the component to be updated (i.e., step S560), prevents invalid component code that has not been updated from being used for other operations, and prevents other operations from affecting the component update.

[0109] In some embodiments, a first tag file can be used to manage the update process of components. Referring to step S350 of the above embodiment, the first tag file is used, for example, to indicate the components in the storage device that are currently in an update process. For example, step S550 can mark the component to be updated as being in an update state by writing an update semaphore of the component to be updated into the first tag file. The update semaphore is used to indicate that the component to be updated in the storage device cannot be subjected to any operation other than the update process, and includes, for example, the component name and / or other tags used to specify the component to be updated. In some embodiments, the update semaphore of the component to be updated written into the first tag file may also include a tag code (corresponding to an update sequence number) as described in the previous embodiments. The update semaphore is, for example, component_A0_fef681b0, component_K0_17d50204, etc., which will not be described again here. After the component to be updated is updated to the code of the target component, the corresponding update semaphore can be cleared from the first tag file, thereby restoring the component in the storage device corresponding to the target component to a non-updating state to indicate that the component is not in an update process.

[0110] However, the embodiments of the present invention are not limited to this, and other methods can also be used to configure the components to be updated to an update state. For example, the first tag file may also include labels for each component (e.g., component names or other labels used to specify the component) and update flag bits corresponding to each label. That is, the first tag file can record whether each component is in the update process by configuring the update flag bits. For example, the update flag bit corresponding to a component can be configured to a first state (e.g., the update flag bit is configured to '1') in the first tag file to indicate that the component is in the update state (in the update process); the update flag bit can be configured to a second state (e.g., the update flag bit is configured to '0') to indicate that the component is in a non-updating state. The update flag bits of each component in the first tag file can be in the second state by default, and the update flag bits corresponding to the updated components are restored from the first state to the second state.

[0111] In step S560, the component to be updated in the storage device is updated based on the code of the target component, and after the update is completed, the component to be updated is restored to a non-updating state, so that the component can be used for other operations (such as copy operations initiated by one or more test tasks mentioned above).

[0112] In an embodiment where the update process of a component is managed using a first tag file, step S560 may clear (or release) the update semaphore corresponding to the component to be updated in the first tag file after the update is completed, or reset the update flag bit corresponding to the component to be updated in the first tag file, so that the component to be updated is restored to a non-updating state, thereby allowing other processes to confirm that the component is not in an update process based on the first tag file.

[0113] In step S570, the update task for the component to be updated is terminated. Thus, the operation of updating the corresponding component in the storage device based on the target component is completed.

[0114] Based on the foregoing, the testing method, component update method, processing system, and computer-readable storage medium provided in this disclosure can be used to determine whether each associated component that has a dependency on the target component is in the update process when testing the target component. This allows the associated component to be copied to a first testing environment for executing the target component's testing tasks when it is not in the update process. According to various embodiments of the present invention, the target component's testing tasks can be executed even when the associated components that have a dependency on the target component are not in the update process, without waiting for the update processes of other non-dependent components to finish. This allows different testing tasks to be executed concurrently, reducing unnecessary waiting between different testing tasks, saving testing time, and improving testing efficiency and the utilization efficiency of the testing environment.

[0115] In some preferred embodiments, the first tag file is used to manage the update status of the components, and the second tag file is used to manage the locking and unlocking of the components. Thus, by searching, reading and writing the first tag file and the second tag file, the update status / lock status of each associated component can be recorded and viewed following operations such as copying and updating, which is simple and convenient.

[0116] In some preferred embodiments, for the same component, the second tag file can record different locking semaphores according to different test tasks, thereby allowing the same component to be copied synchronously to the test environment of different test tasks without unnecessary queuing; and since the locking semaphores are written and cleared independently for different test tasks, the start and end of different copy operations do not affect each other, further improving test efficiency and saving test time.

[0117] In some preferred embodiments, for the same component, the first tag file records different update semaphores according to the different update versions of the component, thereby allowing the corresponding component in the storage device to be updated only based on the latest version of the target component when there are multiple update versions of a component, thereby realizing the aggregation of update tasks, saving software and hardware resources, and improving update efficiency.

[0118] In some preferred embodiments, the components stored / updated in the storage device are verified and pre-compiled components. That is, the associated components copied from the storage device to the first test environment can be directly used for test tasks without needing to be compiled in the first test environment. Therefore, if the compilation of the target component does not depend on the associated components, the first test environment only needs to compile the target component to be tested when executing the test task, without compiling the associated components, which simplifies the process and saves compilation resources.

[0119] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0123] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0124] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0125] Computer-readable storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium, which can be used to store information accessible by a computing device.

[0126] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0127] As described above, these embodiments of the present invention do not exhaustively cover all details, nor do they limit the invention to the specific embodiments described. Clearly, many modifications and variations can be made based on the above description. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the present invention, thereby enabling those skilled in the art to effectively utilize the present invention and its modifications.

Claims

1. A testing method, wherein, include: Load the target component into the first test environment; Identify at least one associated component that has a dependency relationship with the target component; Determine whether each of the associated components of the target component is in the update process. If the associated component is not in the update process, copy the associated component to the first test environment. as well as In the first test environment, test tasks are performed on the target component based on the at least one associated component. The step of copying the associated component to the first test environment includes: The associated component to be copied is locked, and the associated component in the locked state cannot be modified; Copy the associated components of the currently locked version to the first test environment so that the test task can be executed based on the associated components of the currently locked version; and Release the test task from locking the associated component.

2. The test method according to claim 1, wherein, The test tasks include construction verification tests and / or smoke tests of the target component, and the test method executes at least one of the test tasks concurrently.

3. The test method according to claim 1, wherein, The step of determining whether each associated component of the target component is in an update process, and copying the associated component to the first test environment if the associated component is not in an update process, includes: The process involves iterating and determining whether there are any related components that have a dependency on the target component but have not been copied to the first test environment. Update confirmation is used to confirm whether the associated component to be copied is in the update process, if the associated component to be copied exists. If so, then wait and copy the associated component to be copied to the first test environment after the update process of the associated component to be copied is completed. If not, then copy the associated component to be copied to the first test environment; Repeat the steps of traversal judgment and update confirmation until at least one associated component that has a dependency relationship with the target component is copied to the first test environment.

4. The test method according to claim 3, wherein, The update confirmation step includes: A search is performed in the first tag file to confirm that the associated component to be copied is in the update process if the first tag file has already marked the associated component to be copied as being in an update state.

5. The test method according to claim 1, wherein, The step of locking the associated component to be copied includes: writing a lock semaphore of the associated component into a second tag file, the lock semaphore pointing to the currently locked version of the associated component, and the lock semaphore indicating that the currently locked version of the associated component cannot be modified; and The step of unlocking the associated component by the test task includes: clearing the lock semaphore corresponding to the test task in the second tag file.

6. The test method according to claim 5, wherein, The locking semaphore includes a tag and a feature code corresponding to the associated component. The feature code is used to distinguish the locking semaphores configured for the same component by different test tasks.

7. A component update method, wherein, include: The test task is performed on the target component based on the test method as described in any one of claims 1 to 6; as well as If the target component successfully passes the test task, the corresponding component to be updated is updated based on the target component. Wherein, if the target component successfully passes the test task, the step of updating the component to be updated based on the target component includes: Confirm whether the component to be updated is in a locked state. If so, then wait and execute the update process after the component to be updated is unlocked. If not, the update process is executed, which is a process of updating the component to be updated based on the target component.

8. The component update method according to claim 7, wherein, The steps to confirm whether the component to be updated is in a locked state include: A search is performed in the second tag file to confirm that the component to be updated is in a locked state if the second tag file contains a lock semaphore corresponding to the component to be updated.

9. The component update method according to claim 7, wherein, The update process includes: Configure the component to be updated to an update state to indicate that the component to be updated is in the update process; Update the component to be updated according to the target component; and After updating the component to be updated, configure the component to be updated to a non-updating state.

10. The component update method according to claim 9, wherein, The steps of updating the component to be updated based on the target component include: The target component is compiled, and the compiled executable file is used to replace the component to be updated.

11. The component update method according to claim 9, wherein, The step of configuring the component to be updated to an update state includes: writing an update semaphore of the component to be updated into a first tag file, the update semaphore being used to indicate that the component to be updated is currently in the update process and cannot be copied; and The step of configuring the component to be updated to a non-updating state includes: clearing the update semaphore corresponding to the update process in the first marker file.

12. The component update method according to claim 11, wherein, The update semaphore includes a tag and / or a marker code corresponding to the component to be updated. The marker code is used to indicate the time order of multiple update tasks to be performed on the target component, so that the update process is executed based on the version of the target component with the latest order.

13. A processing system, characterized in that, include: The processor is used to execute the scheduling toolkit; as well as Storage device, storing multiple verified components, The scheduling toolkit is configured as follows: Load the target component into the first test environment; Identify at least one associated component among the plurality of verified components that has a dependency relationship with the target component; and Determine whether each of the associated components of the target component is in an update process. If the associated component is not in an update process, copy the associated component to the first test environment, so that the processor performs a test task on the target component in the first test environment based on the at least one associated component copied to the first test environment. The configuration in the scheduling toolkit for copying the associated component to the first test environment includes: The associated component is locked, and the associated component in the locked state cannot be modified; Copy the associated component of the currently locked version to the first test environment so that the test task can be executed based on the associated component of the currently locked version; and Release the test task from locking the associated component.

14. A computer-readable storage medium having instructions stored thereon, wherein, The instructions are executed by one or more processing units to implement the test method as described in any one of claims 1 to 6 or the component update method as described in any one of claims 7 to 12.

Citation Information

Patent Citations

  • Automatized test method and system based on task scheduling

    CN101246439A

  • System and method for a software distribution service

    CN101410800A