CN115904952A - Test environment automatic configuration method, device, equipment and storage medium - Google Patents
Test environment automatic configuration method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115904952A CN115904952A CN202211384917.7A CN202211384917A CN115904952A CN 115904952 A CN115904952 A CN 115904952A CN 202211384917 A CN202211384917 A CN 202211384917A CN 115904952 A CN115904952 A CN 115904952A
- Authority
- CN
- China
- Prior art keywords
- test
- program file
- server
- information
- system configuration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 290
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000012827 research and development Methods 0.000 claims abstract description 39
- 238000013515 script Methods 0.000 claims abstract description 35
- 230000008859 change Effects 0.000 claims description 22
- 238000011161 development Methods 0.000 claims description 22
- 238000004590 computer program Methods 0.000 claims description 4
- 238000001514 detection method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013522 software testing Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007613 environmental effect Effects 0.000 description 1
- 238000005111 flow chemistry technique Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The application provides a method, a device, equipment and a storage medium for automatically configuring a test environment, wherein the method comprises the following steps: acquiring a program file, a storage path and a database script associated with a target work item from a research and development server, and acquiring system configuration information of the program file from a system configuration library; acquiring test version information supported by a test server from the test server, and determining whether to test a target work item according to the test version information and system configuration information; if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package. The method and the device can realize automation of test environment configuration, and improve accuracy, timeliness and configuration efficiency of the test environment configuration.
Description
Technical Field
The present application relates to the field of software testing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for automatically configuring a test environment.
Background
Configuring the test environment is a very important stage in the test implementation, and the suitability of the test environment can seriously affect the authenticity and correctness of the test result.
At present, testing environments are manually configured by testers, the testers need to prepare different testing environments to meet the requirements of different test cases, each environment can be deployed on different machines, and in actual testing, the work can be repeatedly executed and run through the life cycle of the whole software testing.
However, since various errors are easily generated by manual operations performed by a tester, the conventional manual test environment has a problem of low efficiency.
Disclosure of Invention
An object of the present application is to provide a method, an apparatus, a device, and a storage medium for automatically configuring a test environment, so as to solve the problem of low efficiency in manually configuring a test environment in the prior art.
In order to achieve the purpose, the technical scheme adopted by the application is as follows:
in a first aspect, the present application provides a method for automatically configuring a test environment, which is applied to a configuration server, and the method includes:
acquiring a program file associated with a target work item, a storage path of the program file and a database script from a research and development server;
according to the identification of the program file and the storage path of the program file, obtaining system configuration information of the program file from a system configuration library, wherein the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file;
acquiring test version information supported by a test server from the test server, and determining whether to test the target work item according to the test version information and the system configuration information;
if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
Optionally, the obtaining, according to the identifier of the program file and the storage path of the program file, system configuration information of the program file from a system configuration library includes:
acquiring a configuration storage path of the program file from the system configuration library according to the identifier of the program file;
determining whether the configuration storage path is consistent with the storage path of the program file;
and if so, acquiring the system configuration information of the program file from a position corresponding to the configuration storage path in the system configuration library.
Optionally, before obtaining the program file associated with the target work item, the storage path of the program file, and the database script from the research and development server, the method further includes:
reading the state information of each work item stored on the research and development server according to a preset period;
and if a first work item with the solved research and development state and the environment state not ready exists, taking the first work item as the target work item.
Optionally, after the sending the deployment package to the target testing device connected to the testing server and the target testing device deploying the testing environment of the target work item according to the deployment package, the method further includes:
and sending state change information to the research and development server, wherein the state change information comprises the identification of the target work item and ready environment state information, and the research and development server updates the environment state of the target work item to be ready.
Optionally, the determining whether to test the target work item according to the test version information and the system configuration information includes:
and if the test version information is lower than the version information of the program file in the system configuration information, determining to test the target work item.
Optionally, the generating a deployment package according to the program file, the database script, and the system configuration information includes:
and combining the program file, the database script and the configuration pipeline command set information of the program file to obtain the deployment package.
Optionally, the method further includes:
and sending the version information of the program file to the test server, and updating the version information of the program file stored on the test server by the test server.
In a second aspect, the present application provides a test environment auto-configuration apparatus, the apparatus comprising:
a first obtaining module to: acquiring a program file associated with a target work item, a storage path of the program file and a database script from a research and development server;
a second obtaining module to: acquiring system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file, wherein the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file;
a determination module to: acquiring test version information supported by a test server from the test server, and determining whether to test the target work item according to the test version information and the system configuration information;
a generation module to: if yes, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
Optionally, the second obtaining module is specifically configured to:
acquiring a configuration storage path of the program file from the system configuration library according to the identifier of the program file;
determining whether the configuration storage path is consistent with a storage path of the program file;
and if so, acquiring the system configuration information of the program file from a position corresponding to the configuration storage path in the system configuration library.
Optionally, the determining module is specifically configured to:
and if the test version information is lower than the version information of the program file in the system configuration information, determining to test the target work item.
Optionally, the generating module is specifically configured to:
and combining the program file, the database script and the configuration pipeline command set information of the program file to obtain the deployment package.
In a third aspect, the present application provides an electronic device, comprising: the test environment automatic configuration system comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when an electronic device runs, the processor is communicated with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the steps of the test environment automatic configuration method.
In a fourth aspect, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the test environment auto-configuration method as described above.
The beneficial effect of this application is: the deployment package is automatically generated by the configuration server according to the program files of the work items and the system configuration information, and the deployment package is sent to the test server for deployment, so that the automation of the test environment configuration is realized, and the accuracy, timeliness and configuration efficiency of the test environment configuration are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram illustrating an application scenario provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for automatically configuring a test environment according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method for obtaining system configuration information according to an embodiment of the present application;
FIG. 4 illustrates a flow chart for determining a target work item provided by an embodiment of the present application;
FIG. 5 is a flowchart illustrating a further method for automatically configuring a test environment according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram illustrating an apparatus for automatically configuring a test environment according to an embodiment of the present disclosure;
fig. 7 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be reversed in order or performed concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Configuring a test environment is a very important task in software testing. Generally, testers manually configure test environments, the testers need to prepare different test environments to meet the requirements of different test cases, each environment can be deployed on different machines, the work can be repeatedly executed and runs through the life cycle of the whole software test, and due to the fact that various errors are inevitable in manual operation, timeliness, accuracy and efficiency of the existing manually configured test environments need to be improved.
In view of the above problems, the present application provides an automatic test environment configuration method, which can be applied to a configuration server, as shown in fig. 1, which is a schematic system architecture diagram of the method provided in the present application, and referring to fig. 1, the present application relates to a research and development server, a configuration server, a test server, and a plurality of test devices. The research and development server stores files of a plurality of work items, and the research and development server can further comprise an interface for uploading/downloading data with the configuration server. The configuration server can detect the work items in the research and development server and configure the work environment for the work items needing to be configured with the test environment, wherein the work items can be task items corresponding to the functions of the software in the server.
Referring to fig. 1, in specific implementation, a configuration server obtains a work item and a related file that need to be configured in a test environment from a research and development server, automatically generates a corresponding deployment package, and sends the deployment package to a test server, where the test server may be connected to a plurality of test devices, and after receiving the deployment package, the test server may perform deployment of the test environment on the corresponding test device according to the deployment package, and the test device may be, for example, an electronic device.
Next, referring to fig. 2, a description is given of the test environment automatic configuration method of the present application, as shown in fig. 2, which is a schematic flow chart of the test environment automatic configuration method provided by the present application, and an execution main body of the method may be the configuration server described above. The method comprises the following steps:
s201: and acquiring a program file, a storage path of the program file and a database script which are associated with the target work item from the research and development server.
Alternatively, the development server may be a server that carries a software development process management system (TFS) that includes development process management and version management functions of codes and programs. The system provides the functions of requirements, development tasks, test tasks, BUG work item flow processing, code and program file storage and version management in the research and development process.
For example, one piece of software in the development server may correspond to a plurality of functions, each function may be decomposed into a plurality of work items, and when the function in the software needs to be tested, the configuration server may pull, from the development server, a program file, a storage path of the program file, and a database script associated with the work item to configure the test environment.
Alternatively, a work item may associate one or more program files and database scripts.
Optionally, the configuration server may further obtain TFS changeset information associated with the work item, where the TFS changeset information may record a file and code change information of each change of the work item, and each program file of the latest version may be determined by the TFS changeset information.
Alternatively, the storage path of the program file may be obtained from the TFS changeset information.
Optionally, the database script may be used to restore a database used for testing when the testing environment is deployed.
S202: according to the identification of the program file and the storage path of the program file, system configuration information of the program file is obtained from a system configuration library, and the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file.
Optionally, each program file may have a different identifier, and for example, the identifier of the program file may be a file name of the program file.
Optionally, the system configuration library may be a rule library pre-configured by the configuration server according to the work items on the research and development server, and the system configuration library may include a path of the program file, deployment information of the program file in a front-end environment, deployment information of the back-end server, deployment information of the database, and deployment information of the test server.
Optionally, the system configuration information of the program file may include version information of the program file, test server environment information of the program file, and configuration pipeline command set information of the program file.
Alternatively, the version information of the program file may be the latest version of the program file determined from the TFS changeset information.
Optionally, the configuration pipeline command set information of the program file may be a command set generated according to the deployment information of the program file in the front-end environment, the deployment information of the back-end server, the deployment information of the program file in the database, and the deployment information of the program file in the test server in the system configuration library, and is used for deploying the program file in the front-end environment, the back-end server, the database, and the test environment on the test server.
S203: and acquiring test version information supported by the test server from the test server, and determining whether to test the target work item according to the test version information and the system configuration information.
Alternatively, the test version information may be version information of a program file supported by the test server.
It should be understood that the testing server is required to test the version of the program file, and the testing server tests the program file in the target work item when determining that the version information of the program file matches the version information required by the testing server according to the system configuration information.
Optionally, the target work item is tested, and the test environment may be deployed for a program file meeting the test requirements of the test server.
As a possible implementation manner, the number of the test servers may be one, for example, the application scenario shown in fig. 1, where one test server is connected to a plurality of test devices, and the test environments are deployed on the plurality of test devices respectively.
As another possible implementation, the number of the test servers may be multiple, and one configuration server is connected to multiple test servers, and the multiple test servers respectively perform the deployment of the test environment.
S204: if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
Optionally, the deployment package may be a data package for performing test environment deployment, and the deployment package may include a program file, a database script, and system configuration information.
As a possible implementation manner, the test server may be connected to a plurality of test devices, each test device is respectively configured to deploy different test environments, after receiving the deployment package, the test server may send the deployment package to the corresponding test device, and the test device deploys the test environment of the work item according to the deployment package. It should be noted that the test device may register with the test server in advance.
For example, assuming that the deployment package a is a test environment for deploying the web page version and the test device a is for deploying the web page version test environment, after the test server receives the deployment package a, the deployment package may be sent to the test device a, and the test device a deploys the web page version test environment according to the deployment package a.
As another possible implementation, it is assumed that the test scenario includes a plurality of distributed test servers, and each test server is respectively configured to deploy different test environments, at this time, the configuration server may send the deployment package to the corresponding test server, and the test server directly performs deployment of the test environments.
In the embodiment of the application, a configuration server acquires a program file associated with a target work item, a storage path of the program file and a database script from a research and development server; acquiring system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file; acquiring test version information supported by a test server from the test server, and determining whether to test a target work item according to the test version information and system configuration information; if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and configuring the test environment of the target work item by the target test equipment according to the deployment package.
The deployment package is automatically generated by the configuration server according to the program files of the work items and the system configuration information, and the deployment package is sent to the test server for deployment, so that the automation of the test environment configuration is realized, and the accuracy, timeliness and configuration efficiency of the test environment configuration are improved.
Next, the step of acquiring the system configuration information of the program file from the system configuration library according to the identifier of the program file and the storage path of the program file will be described, as shown in fig. 3, where the step S202 includes:
s301: and acquiring the configuration storage path of the program file from the system configuration library according to the identifier of the program file.
Alternatively, the configuration storage path may be a storage path of a program file recorded in the system configuration library.
It should be noted that the system configuration library may be pre-configured by each work item and the program file of each work item in the development server in advance, and therefore, the configuration storage path of the same storage file in the system configuration library and the storage path thereof in the development server may be the same.
Optionally, the configuration server may include an environment configuration module, and the environment configuration module may obtain the configuration storage path of the program file in the system configuration library according to the identifier of the program file, for example, the file name of the program file.
S302: it is determined whether the configuration storage path is consistent with a storage path of the program file.
Optionally, the environment configuration module of the configuration server may compare the storage path of the program file with a configuration storage path of the program file in the system configuration library, so as to determine whether the configuration storage path is consistent with the storage path of the program file.
S303: and if so, acquiring the system configuration information of the program file from a position corresponding to the configuration storage path in the system configuration library.
Optionally, if the configuration storage path is consistent with the storage path of the program file, the environment configuration module may obtain the system configuration information of the program file from a location corresponding to the configuration storage path in the system configuration library.
As another possible implementation manner, the environment configuration module may also directly search in the system configuration library according to the storage path of the program file, so as to obtain the system configuration information of the program file.
In the embodiment of the application, the system configuration information required by each work item can be stored in advance through the system configuration library, so that the efficiency of automatic configuration of the test environment is improved.
It should be noted that, because the system configuration rule base is pre-established, some information of the program file may be changed after the system configuration rule base is established, when the system configuration information is acquired from the system configuration rule base, the configuration server may further update the information of the program file in the system configuration rule base according to the latest information of the program file in the TFS change set information, and exemplarily, may update the version information of the program file to ensure consistency of the version information of the program file in the configuration server and the development server, and improve accuracy of test environment deployment for the program file.
Next, a description is given of the steps before the program file associated with the target work item, the storage path of the program file, and the database script are acquired from the research and development server, as shown in fig. 4, the steps before the step S201 further include:
s401: and reading the state information of each work item stored on the research and development server according to a preset period.
Optionally, the configuration server may include a state detection module, and the state detection module may read state information of each work item stored in the research and development server according to a preset period, and for example, the state detection module may detect states of the TFS requirement, the test task, and the BUG work item regularly.
Optionally, the status information of the work item may include a development status and an environmental status of the work item.
S402: and if the first work item with the research and development state being solved and the environment state being not ready exists, taking the first work item as a target work item.
Optionally, the development status may represent the development progress of the work item in the development server, and when the development is completed, the development status may be solved.
Optionally, the environment status may represent whether the work item has been configured to complete the test environment, and when the test environment has not been configured to complete, the environment status may be not ready.
For example, assuming that there are a plurality of work items whose development states are resolved and whose environment states are not ready, the environment configuration module may sequentially determine the work items as target work items, and perform the above steps S201 to S204, respectively, to complete the configuration of the test environment.
In the embodiment of the application, the work items needing to be configured for the test environment can be timely known through the state detection module, and the timeliness of the configuration for the test environment is improved.
The following is a description of a step after the target test device sends the deployment package to the target test device connected to the test server, and the target test device deploys the test environment of the target work item according to the deployment package, where the step S204 further includes:
and sending state change information to the research and development server, wherein the state change information comprises the identification of the target work item and ready environment state information, and the research and development server updates the environment state of the target work item to be ready.
Optionally, after the test environment deployment is completed, the environment configuration module may send state change information to the research and development server, where the state change information may be used to indicate the research and development server to change the environment state of the work item.
For example, after receiving the state change information sent by the environment configuration module, the research and development server may analyze the identifier of the work item in the state change information, determine the work item requiring state change according to the identifier, and change the environment state of the work item to be ready.
In the embodiment of the application, the environment configuration module sends the state change information to the development server, so that the environment state of the work items which are configured in the test environment is changed in time, and the efficiency of the test environment configuration stage is improved.
Fig. 5 is a schematic diagram of interaction when a test environment is configured among a configuration server, a research and development server, and a test server, where as shown in fig. 5, the configuration server may include a state detection module, an environment configuration module, and a system configuration library.
Referring to fig. 5, the state detection module may periodically detect the development server to determine a work item that needs to be subjected to test environment configuration, and when it is detected that the development state is solved, send a command to the environment configuration module if the environment state is an unserviceable work item, the environment configuration module pulls a program file and a database script of the work item through an API interface of the development server, the environment configuration module obtains system configuration information corresponding to each program file from the system configuration library, and performs verification (i.e., determines whether to test a target work item) according to the system configuration information and test version information of the test server, generates a deployment package for the program file that passes the verification, and sends the deployment package to the test server, the test server returns a deployment result to the environment configuration module after completing deployment and updates the test version information, and the environment configuration module sends state change information to the development server to indicate the development server to modify the environment state of the work item.
It should be noted that, in actual implementation, a plurality of test servers may be deployed in a distributed manner, or a plurality of test devices may be deployed in a distributed manner under one test server, so as to configure different test environments for each program file.
Next, the step of determining whether to test the target work item according to the test version information and the system configuration information will be described, where the step S203 includes:
and if the test version information is lower than the version information of the program file in the system configuration information, determining to test the target work item.
Optionally, the environment configuration module may compare the test version information with version information of the program file, if the version of the program file is lower than the test version information, the program file may be considered as unable to be tested on the test server, and the program file may be discarded, and if the test version information is lower than the version information of the program file, the program file may be considered as able to be tested on the test server, and a deployment package may be generated for the program file and the program file is tested.
It should be noted that, when the test version information is the same as the version information of the program file in the system configuration information, it may also be considered that the program file may be tested on the test server and a deployment package may be generated for the program file.
In the embodiment of the application, the configuration server automatically acquires the test version information from the test server, and determines whether the program file can be tested according to the test version information and the version information of the program file, so that the complexity of comparison needing to be paid attention during manual operation is reduced, and the deployment efficiency of the test environment is improved.
The following is a description of the above-mentioned steps of generating a deployment package according to the program file, the database script, and the system configuration information, and the step S204 includes:
and combining the program file, the database script and the configuration pipeline command set information of the program file to obtain a deployment package.
Optionally, the environment configuration module may combine the program file, the database script corresponding to the program file, and the configuration pipeline command set information of the program file to obtain the deployment package of the program file.
Optionally, after the deployment package is obtained, the environment configuration module may send the deployment package to the test server, and the test server performs environment deployment according to the deployment package to start configuration work of the test environment.
For example, when the test server or the test device performs environment deployment, the command set may be executed to configure the test environment front-end program file and the back-end database.
Optionally, the determining to test the target work item according to the test version information and the system configuration information further includes:
and sending the version information of the program file to a test server, and updating the version information of the program file stored on the test server by the test server.
Optionally, after the configuration of the test environment is completed, the configuration server may send the version information of the program file to the test server, and the test server updates the test version information to the version information of the program file sent by the configuration server.
In the embodiment of the application, the version information of the program file is synchronized on the test server in time, so that the test server can update the test version information in time, and the accuracy and timeliness of subsequent test environment configuration are improved.
Based on the same inventive concept, the embodiment of the present application further provides an automatic test environment configuration device corresponding to the automatic test environment configuration method, and since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the automatic test environment configuration method in the embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Referring to fig. 6, a schematic diagram of an automatic configuration apparatus for a test environment according to an embodiment of the present application is shown, where the apparatus includes: a first obtaining module 601, a second obtaining module 602, a determining module 603, and a generating module 604, wherein:
a first obtaining module 601, configured to: acquiring a program file associated with a target work item, a storage path of the program file and a database script from a research and development server;
a second obtaining module 602, configured to: acquiring system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file, wherein the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file;
a determining module 603 configured to: acquiring test version information supported by a test server from the test server, and determining whether to test a target work item according to the test version information and system configuration information;
a generating module 604 for: if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
Optionally, the second obtaining module 602 is specifically configured to:
acquiring a configuration storage path of the program file from a system configuration library according to the identifier of the program file;
determining whether the configuration storage path is consistent with the storage path of the program file;
and if so, acquiring the system configuration information of the program file from the position corresponding to the configuration storage path in the system configuration library.
Optionally, the determining module 603 is specifically configured to:
and if the test version information is lower than the version information of the program file in the system configuration information, determining to test the target work item.
Optionally, the generating module 604 is specifically configured to:
and combining the program file, the database script and the configuration pipeline command set information of the program file to obtain a deployment package.
Optionally, the automatic configuration device for test environment in the present application may further include: state detection module, state change module and version update module, wherein:
the state detection module is specifically configured to:
reading state information of each work item stored on the research and development server according to a preset period;
and if the first work item with the research and development state being solved and the environment state being not ready exists, taking the first work item as a target work item.
The state change module is specifically configured to:
and sending state change information to the research and development server, wherein the state change information comprises the identification of the target work item and ready environment state information, and the research and development server updates the environment state of the target work item to be ready.
The version update module is specifically configured to:
and sending the version information of the program file to a test server, and updating the version information of the program file stored on the test server by the test server.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
According to the embodiment of the application, a program file related to a target work item, a storage path of the program file and a database script are obtained from a research and development server through a configuration server; acquiring system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file; acquiring test version information supported by a test server from the test server, and determining whether to test a target work item according to the test version information and system configuration information; if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
The deployment package is automatically generated by the configuration server according to the program files of the work items and the system configuration information, and the deployment package is sent to the test server for deployment, so that the automation of the test environment configuration is realized, and the accuracy, timeliness and configuration efficiency of the test environment configuration are improved.
An embodiment of the present application further provides an electronic device, as shown in fig. 7, which is a schematic structural diagram of the electronic device provided in the embodiment of the present application, and the electronic device includes: a processor 71, a memory 72 and a bus. The memory 72 stores machine-readable instructions (for example, execution instructions corresponding to the first obtaining module 601, the second obtaining module 602, the determining module 603, and the generating module 604 in the apparatus in fig. 6, etc.) executable by the processor 71, when the computer device runs, the processor 71 communicates with the memory 72 through the bus, and the machine-readable instructions are executed by the processor 71 to perform the process of the test environment automatic configuration method.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the automatic configuration method for the test environment are executed.
It can be clearly understood by those skilled in the art that, for convenience and simplicity of description, the specific working process of the system and the apparatus described above may refer to the corresponding process in the method embodiment, and is not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or modules, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.
Claims (10)
1. A test environment automatic configuration method is applied to a configuration server, and comprises the following steps:
acquiring a program file associated with a target work item, a storage path of the program file and a database script from a research and development server;
acquiring system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file, wherein the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file;
acquiring test version information supported by a test server from the test server, and determining whether to test the target work item according to the test version information and the system configuration information;
if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
2. The method according to claim 1, wherein the obtaining system configuration information of the program file from a system configuration library according to the identifier of the program file and the storage path of the program file comprises:
acquiring a configuration storage path of the program file from the system configuration library according to the identifier of the program file;
determining whether the configuration storage path is consistent with a storage path of the program file;
and if so, acquiring the system configuration information of the program file from a position corresponding to the configuration storage path in the system configuration library.
3. The method of claim 1, wherein before the obtaining the program file associated with the target work item, the storage path of the program file, and the database script from the development server, the method further comprises:
reading state information of each work item stored in the research and development server according to a preset period;
and if a first work item with the solved research and development state and the environment state not ready exists, taking the first work item as the target work item.
4. The method of claim 3, wherein the sending the deployment package to a target testing device connected to the testing server, after the target testing device deploys the testing environment of the target work item according to the deployment package, further comprises:
and sending state change information to the research and development server, wherein the state change information comprises the identification of the target work item and ready environment state information, and the research and development server updates the environment state of the target work item to be ready.
5. The method of claim 1, wherein determining whether to test the target work item based on the test version information and the system configuration information comprises:
and if the test version information is lower than the version information of the program file in the system configuration information, determining to test the target work item.
6. The method of claim 1, wherein generating a deployment package from the program file, the database script, and the system configuration information comprises:
and combining the program file, the database script and the configuration pipeline command set information of the program file to obtain the deployment package.
7. The method of claim 5, further comprising:
and sending the version information of the program file to the test server, and updating the version information of the program file stored on the test server by the test server.
8. An apparatus for automatically configuring a test environment, comprising:
a first obtaining module to: acquiring a program file associated with a target work item, a storage path of the program file and a database script from a research and development server;
a second obtaining module to: according to the identification of the program file and the storage path of the program file, obtaining system configuration information of the program file from a system configuration library, wherein the system configuration information comprises: version information of the program file and configuration pipeline command set information of the program file;
a determination module to: acquiring test version information supported by a test server from the test server, and determining whether to test the target work item according to the test version information and the system configuration information;
a generation module to: if so, generating a deployment package according to the program file, the database script and the system configuration information, sending the deployment package to target test equipment connected with the test server, and deploying the test environment of the target work item by the target test equipment according to the deployment package.
9. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the program instructions to perform the steps of the test environment automatic configuration method according to any one of claims 1 to 7 when executed.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the test environment auto-configuration method according to one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211384917.7A CN115904952A (en) | 2022-11-07 | 2022-11-07 | Test environment automatic configuration method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211384917.7A CN115904952A (en) | 2022-11-07 | 2022-11-07 | Test environment automatic configuration method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115904952A true CN115904952A (en) | 2023-04-04 |
Family
ID=86479749
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211384917.7A Pending CN115904952A (en) | 2022-11-07 | 2022-11-07 | Test environment automatic configuration method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115904952A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116360800A (en) * | 2023-05-29 | 2023-06-30 | 天翼云科技有限公司 | Deployment method and device of code branching environment and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108196878A (en) * | 2018-01-22 | 2018-06-22 | 广东小天才科技有限公司 | Method and device for generating application program installation package, electronic equipment and storage medium |
CN112131102A (en) * | 2020-08-28 | 2020-12-25 | 山东浪潮通软信息科技有限公司 | Software project management system, equipment and medium in micro-service mode |
CN112988571A (en) * | 2021-02-09 | 2021-06-18 | 中国建设银行股份有限公司 | Automated compiling and deploying method and system for optimizing CC codes |
CN114968707A (en) * | 2022-05-07 | 2022-08-30 | 远光软件股份有限公司 | Method and device for controlling work item state, storage medium and computer equipment |
CN115185570A (en) * | 2022-07-12 | 2022-10-14 | 金拱门(中国)有限公司 | JIRA system-based task flow processing method, system, device, medium, and computer program product |
-
2022
- 2022-11-07 CN CN202211384917.7A patent/CN115904952A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108196878A (en) * | 2018-01-22 | 2018-06-22 | 广东小天才科技有限公司 | Method and device for generating application program installation package, electronic equipment and storage medium |
CN112131102A (en) * | 2020-08-28 | 2020-12-25 | 山东浪潮通软信息科技有限公司 | Software project management system, equipment and medium in micro-service mode |
CN112988571A (en) * | 2021-02-09 | 2021-06-18 | 中国建设银行股份有限公司 | Automated compiling and deploying method and system for optimizing CC codes |
CN114968707A (en) * | 2022-05-07 | 2022-08-30 | 远光软件股份有限公司 | Method and device for controlling work item state, storage medium and computer equipment |
CN115185570A (en) * | 2022-07-12 | 2022-10-14 | 金拱门(中国)有限公司 | JIRA system-based task flow processing method, system, device, medium, and computer program product |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116360800A (en) * | 2023-05-29 | 2023-06-30 | 天翼云科技有限公司 | Deployment method and device of code branching environment and electronic equipment |
CN116360800B (en) * | 2023-05-29 | 2023-10-13 | 天翼云科技有限公司 | Deployment method and device of code branching environment and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109634843B (en) | Distributed automatic software testing method and platform for AI chip platform | |
CN108959059B (en) | Test method and test platform | |
CN109902005B (en) | Automatic testing method and system | |
CN112241360A (en) | Test case generation method, device, equipment and storage medium | |
CN108536593A (en) | CS Framework Softwares automated testing method based on UI and system | |
CN109840194B (en) | Method and system for detecting configuration file | |
CN103399814B (en) | The method and device of automatic test | |
CN107632901A (en) | A kind of self-repair method and device of application program operation exception | |
WO2021077916A1 (en) | Method and device for acquiring mirror image file | |
CN115454869A (en) | Interface automation test method, device, equipment and storage medium | |
CN112069073A (en) | Test case management method, terminal and storage medium | |
CN110795356A (en) | System and method for realizing one-click deployment and automatic testing of software based on android | |
CN115904952A (en) | Test environment automatic configuration method, device, equipment and storage medium | |
CN113742215A (en) | Method and system for automatically configuring and calling test tool to perform test analysis | |
CN107357721B (en) | Method and device for testing system | |
KR102165747B1 (en) | Lightweight crash report based debugging method considering security | |
CN112905403B (en) | Batch synchronous testing method and system for multiple computers | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
CN101017496A (en) | Method and apparatus for automatically formatting data based on a best match test result type | |
CN110471828B (en) | Operating system testing method, device and equipment thereof | |
CN111159028A (en) | Webpage testing method and device | |
CN112596750B (en) | Application testing method and device, electronic equipment and computer readable storage medium | |
CN111858315B (en) | Software debugging method, device, equipment and medium based on version management | |
CN111367796B (en) | Application program debugging method and device | |
CN112256554B (en) | Method and equipment for testing based on scene test cases |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |