CN111352997A - Test environment verification method and system - Google Patents

Test environment verification method and system Download PDF

Info

Publication number
CN111352997A
CN111352997A CN202010127588.2A CN202010127588A CN111352997A CN 111352997 A CN111352997 A CN 111352997A CN 202010127588 A CN202010127588 A CN 202010127588A CN 111352997 A CN111352997 A CN 111352997A
Authority
CN
China
Prior art keywords
field
database
test environment
environment database
testing environment
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
Application number
CN202010127588.2A
Other languages
Chinese (zh)
Inventor
万光平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202010127588.2A priority Critical patent/CN111352997A/en
Publication of CN111352997A publication Critical patent/CN111352997A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application is applicable to the technical field of software development, and provides a test environment checking method and a system, wherein the test environment checking method comprises the following steps: connecting the first testing environment database and the second testing environment database; acquiring a first check object from the first test environment database according to the check instruction, and acquiring a second check object from the second test environment database; and calling a comparison tool to compare the first check object with the second check object, and outputting a comparison result. The databases corresponding to different test environments are connected, and objects to be checked are automatically compared based on the comparison tool, so that whether the databases of the test environments of different versions are synchronized successfully or not is judged, the test efficiency can be improved, the code quality is improved, and the stable operation of the production environment is ensured.

Description

Test environment verification method and system
Technical Field
The application belongs to the technical field of software development, and particularly relates to a test environment verification method and system.
Background
In the development process of a software program, the software program is usually required to be developed, tested and operated, the development is required to be performed in a development environment, the testing is required to be performed in a test environment, and the operation is required to be performed in a production environment. The test environment refers to a general term of computer hardware, software, network equipment and historical data which are necessary for completing software test work, and the test environment is in charge of development environment and production environment, so that the quality of codes and the stability of the production environment are guaranteed.
Because many system modules are used for developing a software program, and multiple versions are available in the development process, multiple sets of test environments are usually set in the development process. For a plurality of sets of test environments, different test environments need to be switched according to different software versions, so that a code synchronization problem under the test environments of different versions exists, for example, the previous version is tested in a test1 environment, but the next version needs to be tested in a test3 environment, at this time, it is required to check whether all the codes in a test1 environment are normally synchronized into a test3 environment, and the detection of the code synchronization is usually performed by a tester, however, missing is easy to occur, and the stability of the production environment is further affected.
Disclosure of Invention
The embodiment of the application provides a test environment checking method and system, and can solve the problem that the code synchronous checking of different test environments is easy to miss, and the stability of the production environment is further influenced.
In a first aspect, an embodiment of the present application provides a test environment verification method, including:
connecting the first testing environment database and the second testing environment database;
acquiring a first check object from the first test environment database according to the check instruction, and acquiring a second check object from the second test environment database;
and calling a comparison tool to compare the first check object with the second check object, and outputting a comparison result.
In a possible implementation manner of the first aspect, the obtaining a first check object from the first testing environment database according to the check instruction, and obtaining a second check object from the second testing environment database includes:
creating and configuring a database configuration table based on the first test environment database and the second test environment database;
and searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction.
In a possible implementation manner of the first aspect, the first check object includes a first configuration file package, the second check object includes a second configuration file package, and the invoking a comparison tool compares the first check object with the second check object and outputs a comparison result, including:
calling a code comparison tool, and automatically checking the first configuration file packet and the second configuration file packet through the code comparison tool;
if the file content of the first configuration file package is consistent with the file content of the second configuration file package, outputting a prompt of successful version synchronization;
and if the file content of the first configuration file package is inconsistent with the file content of the second configuration file package, outputting a version synchronization failure prompt.
In a possible implementation manner of the first aspect, the first check object includes a first database table, the second check object includes a second database table, and the invoking a comparison tool compares the first check object with the second check object and outputs a comparison result, including:
calling a structured query language to respectively count the data volume of the first database table and the data volume of the second database table;
if the data volume of the first database table is equal to the data volume of the database configuration table of the second test environment database, outputting a prompt of successful version synchronization;
and if the data volume of the first database table is not equal to the data volume of the second database table, outputting a version synchronization failure prompt.
In a possible implementation manner of the first aspect, the database configuration table includes a version number field, an address field, an interface field, a user field, a password field, and a configuration file packet field;
the searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction includes:
determining first configuration file packet information and second configuration file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first configuration file packet from the first testing environment database according to the version number field, the configuration file packet field and the first configuration file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second configuration file packet from the second testing environment database according to the version number field, the configuration file packet field and the second configuration file packet information.
In a possible implementation manner of the first aspect, the database configuration table further includes a table name field, a first data volume field, and a second data volume field;
the searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction includes:
determining first database table information and second database table information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first database table from the first testing environment database according to the table name field, the first data volume field and the first database table information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second database table from the second testing environment database according to the table name field, the second data volume field and the second database table information.
In a possible implementation manner of the first aspect, the database configuration table further includes an ear file package field;
the searching and acquiring the first check object and the second check object from the database table according to the check instruction includes:
determining first ear file packet information and second ear file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first ear file packet from the first testing environment database according to the version number field, the ear file packet field and the first ear file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second ear file packet from the second testing environment database according to the version number field, the ear file packet field and the second ear file packet information.
In a second aspect, an embodiment of the present application provides a test environment verification system, including:
the connection module is used for connecting the first test environment database and the second test environment database;
the acquisition module is used for acquiring a first check object from the first test environment database according to the check instruction and acquiring a second check object from the second test environment database;
and the comparison module is used for calling a comparison tool to compare the first check object with the second check object and outputting a comparison result.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the test environment verification method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the test environment verification method according to the first aspect
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, causes the terminal device to execute the test environment verification method according to any one of the above first aspects.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Compared with the prior art, the embodiment of the application has the advantages that: the databases corresponding to different test environments are connected, and objects to be checked are automatically compared based on the comparison tool, so that whether the databases of the test environments of different versions are synchronized successfully or not is judged, the test efficiency can be improved, the code quality is improved, and the stable operation of the production environment is ensured.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a test environment verification method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an operable interface to which a test environment verification method according to an embodiment of the present application is applied;
fig. 3 is a schematic flow chart illustrating an implementation of S102 in the testing environment verifying method according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of a test environment verification system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The test environment verification method provided by the embodiment of the application can be applied to terminal devices such as a mobile phone, a tablet personal computer, a wearable device, a vehicle-mounted device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA) and the like, and the embodiment of the application does not limit the specific type of the terminal device at all.
Illustratively, the test environment verification method provided by the embodiment of the present application is applied to computer equipment, including front-end equipment and back-end equipment. The front-end device may be a device capable of providing an operable interface, so that a user selects a verification object based on the operable interface, and the front-end equipment can generate a corresponding verification instruction according to the verification object selected by the user and send the verification instruction to the back-end equipment, wherein the back-end equipment can be equipment capable of providing a JAVA interface, connecting databases of different test environments to the back-end equipment through JAVA interface, acquiring corresponding check objects from the connected databases, synchronously checking codes, feeding back comparison results to the front-end equipment after checking, so that the front-end equipment can display the comparison result, so that the user can conveniently carry out corresponding operation according to the comparison result, if the comparison result is synchronization success, the test is carried out under the current test environment, and if the comparison result is synchronization failure, the position of the synchronization failure is positioned so as to analyze the failure reason. It should be noted that the backend device may also be a server device.
Referring to fig. 1, an embodiment of the present application provides a testing environment checking method applied to the computer device, where the testing environment checking method includes:
s101: the first test environment database and the second test environment database are connected.
Specifically, the first testing environment database is a testing environment database of a current version code, and the second testing environment database is a testing environment database of a previous version code. The first testing environment database can be a MySQL database or an Oracle database. Similarly, the second testing environment database may be a MySQL database or an Oracle database.
Specifically, the first test environment Database and the second test environment Database are respectively connected to the backend device through a jdbc (java Database connectivity) interface.
Specifically, the first testing environment database includes a mechanism library, a class library and a pala library, and the second testing environment database includes a mechanism library, a class library and a pala library, when the first testing environment database and the second testing environment database are accessed to the back-end device, the mechanism library of the first testing environment database and the mechanism library of the second testing environment database need to be accessed correspondingly, the class library of the first testing environment database and the class library of the second testing environment database need to be accessed correspondingly, and the pala library of the first testing environment database and the pala library of the second testing environment database need to be accessed correspondingly. It should be noted that: the organization library is mainly used for storing data and codes for calculating the underwriting and claims of the insurance policy; the class library is mainly used for storing data and codes during finance and actuarial month settlement; the Pala library is mainly used for data and codes modeled by using a actuarial service, and the corresponding access is used for comparing the synchronous conditions of the codes based on the test environment of each library.
S102: and acquiring a first check object from the first test environment database according to the check instruction, and acquiring a second check object from the second test environment database.
Specifically, the check instruction is an instruction generated by the front-end device according to a check object selected by a user, and the check instruction includes an object to be subjected to code synchronization comparison, that is, the check object. The check object may be a configuration file package (PKG package), an ear package, or a data operation statement (dml statement) corresponding to a database table. And the checking instruction also comprises a test environment database corresponding to the two software versions needing code synchronous comparison. Namely, two testing environment databases to be verified can be determined according to the verification instruction, and a verification object to be verified can be obtained from the corresponding testing environment databases.
Specifically, the front-end device may provide an operable interface to the user, for example, as shown in fig. 2, the user may select a version of the test environment, then input an object to be verified, such as a PKG package name, an ear package name, a database table name, and the like, and then click a button for synchronous verification, and then automatically generate a corresponding verification instruction according to the version of the test environment and the verification object selected by the user. For example, the PKG1 of the first test environment database and the PKG1 of the second test environment database are input at the front end, i.e., the objects to be compared for the codes are the PKG1 of the first test environment database and the PKG2 of the second test environment database. The backend device accesses the first test environment database according to the database configuration table and obtains a package of files named PKG1 (i.e., the first check object), and accesses the second test environment database according to the database configuration table and obtains a package of files named PKG1 (the second check object). For example, if the table _ name1 database of the first testing environment database and the table _ name1 database of the second testing environment database are input at the front end, the backend device accesses the first testing environment database according to the database configuration table and obtains the database table named table _ name1, and counts the data amount of the database table (i.e., the first check object), and accesses the second testing environment database according to the database configuration table and obtains the database table named table _ name1, and counts the data amount of the database table (the second check object).
Specifically, an operation button may be further disposed in the operable interface, and the operation button includes a PKG package comparison button and a dml statement comparison button, and the PKG package comparison is performed on the PKG packages of the selected different test environment databases by clicking the PAK package comparison button. The dml statement alignment is performed on the selected different slave test environment database tables by clicking on the dml statement alignment button. The user can automatically check whether the test environment is synchronously finished or not only by clicking the operation button, and the operation is simple
S103: and calling a comparison tool to compare the first check object with the second check object, and outputting a comparison result.
Specifically, the code comparison tool is called by the back-end device to automatically compare the acquired first check object with the acquired second check object, and then whether the two check objects are consistent or not is judged, if so, the codes of the test environments of the two versions are successfully synchronized, so that the output comparison result is a comparison result which is successfully synchronized, and if not, the codes of the test environments of the two versions are failed to be synchronized, so that the output comparison result is a comparison result which is failed to be synchronized. In this embodiment, the code alignment tool is a constrained match tool. The byondcompare tool can be called to compare codes by setting a corresponding call command in the back-end equipment.
In this embodiment, the first check object includes a first configuration file package, the second check object includes a second configuration file package, and the S103 includes the following steps:
calling a code comparison tool, and automatically checking the first configuration file packet and the second configuration file packet through the code comparison tool;
if the file content of the first configuration file package is consistent with the file content of the second configuration file package, outputting a prompt of successful version synchronization;
and if the file content of the first configuration file package is inconsistent with the file content of the second configuration file package, outputting a version synchronization failure prompt.
Specifically, the backend device calls a constrained tool through JAVA, automatically checks a first configuration file packet of the first testing environment database and a second configuration file packet of the second testing environment database through the constrained tool, and if the contents of the first configuration file packet of the first testing environment database and the second configuration file packet of the second testing environment database are consistent, the version synchronization is successful; and if the contents of the first configuration file packet of the first test environment database and the second configuration file packet of the second test environment database are not consistent, the version synchronization fails. And outputting a synchronization success prompt when the version synchronization is successful, outputting a synchronization failure prompt when the version synchronization is failed, and positioning the synchronization failure prompt to the position of the configuration file packet with failed synchronization.
Specifically, after the code synchronization is completed, the data volumes corresponding to the databases in different versions of the test environment are the same, so the check object may also be the data volumes of the database tables corresponding to the databases in different test environments, the data volume of the database table to be checked is counted by an SQL statement, and whether the data volumes of the database tables in the databases in different versions of the test environment are equal is judged, if so, the version synchronization is successful, and thus, the output comparison result is a comparison result of successful synchronization. If the comparison result is not equal to the comparison result, the version synchronization fails, so that the output comparison result is the comparison result of the synchronization failure and is positioned to the database table of the database of which the synchronization fails.
In this embodiment, the first check object includes a first database table, the second check object includes a second database table, and the step S103 includes the following steps:
calling a structured query language to respectively count the data volume of the first database table and the data volume of the second database table;
if the data volume of the first database table is equal to the data volume of the database configuration table of the second test environment database, outputting a prompt of successful version synchronization;
and if the data volume of the first database table is not equal to the data volume of the second database table, outputting a version synchronization failure prompt.
Specifically, the back-end device respectively counts the data volume of a certain database table of the first testing environment database and the data volume of the same-name database table of the second testing environment database through the SQL statement, and compares whether the two data volumes are equal. If the data volume of the database table of the first test environment is equal to the data volume of the database table of the second test environment database, the version synchronization is successful, and if the data volume of the database table of the first test environment is not equal to the data volume of the database table of the second test environment database, the version synchronization is successful. And outputting a synchronization success prompt when the version synchronization is successful, outputting a synchronization failure prompt when the version synchronization is failed, and positioning the synchronization failure prompt to a database table of the test environment database with failed synchronization.
Specifically, an automatic check task may be set through the database configuration table, and each configuration file packet in the configuration file packet field of the database configuration table is checked once.
According to the test environment calibration method provided by the embodiment, the databases corresponding to different test environments are connected, and the objects to be calibrated are automatically compared based on the comparison tool, so that whether the databases of the test environments of different versions are synchronized successfully or not is judged, the test efficiency can be improved, the code quality is improved, and the stable operation of the production environment is ensured.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a testing environment verifying method according to another embodiment of the present application. The difference between the present embodiment and the previous embodiment is that S102 of the testing environment verification method provided in the present embodiment specifically includes the following steps, which are detailed as follows:
s201: creating and configuring a database configuration table based on the first test environment database and the second test environment database.
Specifically, before the first verification object and the second verification object are obtained according to the verification instruction, a database configuration table needs to be created first, and the database configuration table is configured according to the information of the first testing environment database and the information of the second testing environment database.
Specifically, a data configuration table may be created in the first test environment database, and fields of the data configuration table may be set, where the fields of the data configuration table include a version number field, an address field, a port field, a user field, a password field, and a profile packet field. And configuring the database configuration table according to the information of the first test environment database and the second test environment database, namely filling the information of the first test environment database and the second test environment database into the database configuration table. The version number field is used for identifying the test version of the test environment database test software; the address field is used for identifying the IP address of the server of the test environment database; the port field is used for identifying a connection port of the database; the user field is used for identifying a user name; the password field is used for identifying an operation password of a user; the profile package field is used to identify the installation package profile (pkg file) that the current version has modified.
Specifically, the database configuration table may also be created in the second testing environment database, and the database configuration table may be configured according to the information of the first testing environment database and the second testing environment database.
Specifically, a table name field, a first data volume field, and a second data volume field may be further added in the database configuration table, where the table name field is used to identify a database table with a modified current version, the first data volume field is used to identify a data volume of a database table of the first testing environment database, and the second data volume field is used to identify a data volume of a database table of the second testing environment database.
After the configuration of the database configuration table is completed, the back-end device can search corresponding information from the database configuration table according to the check instruction, access the corresponding test environment database, and obtain the check objects (i.e., the first check object and the second check object) included in the check instruction.
S202: and searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction.
Specifically, after the database configuration table is completed, the check object to be checked is analyzed based on the check instruction generated by the check object selected by the user, and the check object may be a configuration file package or a database table. And the related information of the verification object, such as the package name of the configuration file package, the table name of the database table and the like, can be obtained by analyzing the verification instruction.
In this embodiment, the step S202 includes the following steps:
determining first configuration file packet information and second configuration file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first configuration file packet from the first testing environment database according to the version number field, the configuration file packet field and the first configuration file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second configuration file packet from the second testing environment database according to the version number field, the configuration file packet field and the second configuration file packet information.
Specifically, the first profile package information includes a package name of the first profile package, and the second profile package information includes a package name of the second profile package. The back-end equipment accesses the first test environment database according to the access address and the access port of the first test environment database through JAVA, searches and acquires a corresponding configuration file packet according to the packet name of the first configuration file packet, accesses the second test environment database according to the access address and the access port of the second test environment database through JAVA, and searches and acquires a corresponding configuration file packet according to the packet name of the second configuration file packet (at this moment, the packet name of the first configuration file packet is the same as the packet name of the second configuration file packet).
In this embodiment, the step S202 may further include the following steps:
determining first database table information and second database table information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first database table from the first testing environment database according to the table name field, the first data volume field and the first database table information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second database table from the second testing environment database according to the table name field, the second data volume field and the second database table information.
Specifically, the first database table information includes a table name of the first database table, and the second database table information includes a table name of the second database table. And after the second database table is obtained, counting the data volume of the second database table, and then writing the data volume of the second database table into the second data volume field of the database configuration table.
In an embodiment, the database configuration table further includes an ear file packet field, and the step S202 further includes the following steps:
determining first ear file packet information and second ear file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first ear file packet from the first testing environment database according to the version number field, the ear file packet field and the first ear file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second ear file packet from the second testing environment database according to the version number field, the ear file packet field and the second ear file packet information.
Specifically, the first ear portfolio information includes a package name of the first ear portfolio, and the second ear portfolio information includes a package name of the second ear portfolio. The ear file package needing to be verified is input or selected at the front end, then the first testing environment database is accessed through the back end device to obtain the first ear file package, and the second testing environment database is accessed to obtain the second ear file package with the same name, so that the synchronous condition of the ear file packages in different testing environments can be verified.
According to the test environment calibration method provided by the embodiment, the database configuration table is created and configured, so that the back-end equipment can access the corresponding test environment database automatically according to the calibration instruction and acquire the calibration object conveniently, the calibration can be effectively performed on the calibration object selected by the user, and the calibration efficiency is improved.
Fig. 4 shows a structural block diagram of the test environment verification system provided in the embodiment of the present application, which corresponds to the test environment verification method described in the above embodiment, and only shows a part related to the embodiment of the present application for convenience of description.
Referring to fig. 4, the testing environment verifying system includes a connection module 11, an obtaining module 12, and a comparing module 13.
The connection module 11 is used for connecting the first test environment database and the second test environment database;
the obtaining module 12 is configured to obtain a first verification object from the first testing environment database according to the verification instruction, and obtain a second verification object from the second testing environment database;
the comparison module 13 is configured to invoke a comparison tool to compare the first check object with the second check object, and output a comparison result.
Further, the acquisition module comprises a configuration unit and an acquisition unit.
The configuration unit is used for creating and configuring a database configuration table based on the first test environment database and the second test environment database;
the obtaining unit is used for searching and obtaining the first check object and the second check object from the database configuration table according to the check instruction.
Further, the first check object comprises a first configuration file package, the second check object comprises a second configuration file package, and the comparison module comprises a calling unit and a prompting unit.
The calling unit is used for calling a code comparison tool and automatically checking the first configuration file packet and the second configuration file packet through the code comparison tool;
the prompting unit is used for outputting a prompt that the version synchronization is successful if the file content of the first configuration file package is consistent with the file content of the second configuration file package; and if the file content of the first configuration file package is inconsistent with the file content of the second configuration file package, outputting a version synchronization failure prompt.
Further, the first check object comprises a first database table and the second check object comprises a second database table.
The calling unit is further used for calling a structured query language to respectively count the data volume of the first database table and the data volume of the second database table.
The prompting unit is further used for outputting a prompt that the version synchronization is successful if the data volume of the first database table is equal to the data volume of the database configuration table of the second test environment database; and if the data volume of the first database table is not equal to the data volume of the second database table, outputting a version synchronization failure prompt.
Further, the database configuration table includes a version number field, an address field, an interface field, a user field, a password field, and a configuration file packet field, and the obtaining unit includes an information determining unit, a first accessing unit, and a second accessing unit.
The information determining unit is used for determining first configuration file packet information and second configuration file packet information according to the checking instruction;
the first access unit is used for searching an access address of the first test environment database according to the address field and the interface field, accessing the access address of the first test environment database according to the user field and the password field, and searching and acquiring a first configuration file packet from the first test environment database according to the version number field, the configuration file packet field and the first configuration file packet information;
the second access unit is used for searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second configuration file packet from the second testing environment database according to the version number field, the configuration file packet field and the second configuration file packet information.
Further, the database configuration table further comprises a table name field, a first data volume field and a second data volume field;
the information determining unit is also used for determining first database table information and second database table information according to the checking instruction.
The first access unit is further configured to search an access address of the first testing environment database according to the address field and the interface field, access the access address of the first testing environment database according to the user field and the password field, and search and acquire a first database table from the first testing environment database according to the table name field, the first data volume field, and the first database table information.
The second access unit is further configured to search an access address of the second testing environment database according to the address field and the interface field, access the access address of the second testing environment database according to the user field and the password field, and search and acquire a second database table from the second testing environment database according to the table name field, the second data volume field, and the second database table information.
Further, the database configuration table further comprises an ear file packet field.
The information determining unit is further used for determining first ear file packet information and second ear file packet information according to the checking instruction.
The first access unit is further configured to search an access address of the first testing environment database according to the address field and the interface field, access the access address of the first testing environment database according to the user field and the password field, and search and acquire a first ear file package from the first testing environment database according to the version number field, the ear file package field, and the first ear file package information
The second access unit is further configured to search an access address of the second testing environment database according to the address field and the interface field, access the access address of the second testing environment database according to the user field and the password field, and search and acquire a second ear file package from the second testing environment database according to the version number field, the ear file package field, and the second ear file package information.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Therefore, the test environment verification system provided by the embodiment can also connect databases corresponding to different test environments and automatically compare objects to be verified based on the comparison tool, so as to judge whether the databases of the test environments of different versions are synchronous or not, improve the test efficiency and the code quality, and ensure the stable operation of the production environment.
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 5, the terminal device 5 of this embodiment includes: at least one processor 50 (only one is shown in fig. 5), a memory 51, and a computer program 52 stored in the memory 51 and operable on the at least one processor 50, wherein the processor 50 executes the computer program 52 to implement the steps in any of the various access control method embodiments described above.
The terminal device 5 may be a desktop computer, a notebook, a palm computer, a cloud terminal device, or other computing devices. The terminal device may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is only an example of the terminal device 5, and does not constitute a limitation to the terminal device 5, and may include more or less components than those shown, or combine some components, or different components, such as an input-output device, a network access device, and the like.
The Processor 50 may be a Central Processing Unit (CPU), and the Processor 50 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 51 may in some embodiments be an internal storage unit of the terminal device 5, such as a hard disk or a memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used for storing an operating system, an application program, a Boot Loader (Boot Loader), data, and other programs, such as program codes of the computer programs. The memory 51 may also be used to temporarily store data that has been output or is to be output.
Illustratively, the computer program 52 may be divided into one or more units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a connection module, an acquisition module and a comparison module, and the specific functions of each unit are as follows:
the connection module is used for connecting the first test environment database and the second test environment database;
the acquisition module is used for acquiring a first check object from the first test environment database according to the check instruction and acquiring a second check object from the second test environment database;
and the comparison module is used for calling a comparison tool to compare the first check object with the second check object and outputting a comparison result.
An embodiment of the present application further provides a network device, where the network device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), random-access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A test environment verification method, comprising:
connecting the first testing environment database and the second testing environment database;
acquiring a first check object from the first test environment database according to the check instruction, and acquiring a second check object from the second test environment database;
and calling a comparison tool to compare the first check object with the second check object, and outputting a comparison result.
2. The test environment verification method of claim 1, wherein the retrieving a first verification object from the first test environment database and a second verification object from the second test environment database according to the verification instruction comprises:
creating and configuring a database configuration table based on the first test environment database and the second test environment database;
and searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction.
3. The method for verifying test environment of claim 1, wherein the first verification object comprises a first configuration file package, the second verification object comprises a second configuration file package, and the invoking the comparison tool compares the first verification object with the second verification object and outputs the comparison result comprises:
calling a code comparison tool, and automatically checking the first configuration file packet and the second configuration file packet through the code comparison tool;
if the file content of the first configuration file package is consistent with the file content of the second configuration file package, outputting a prompt of successful version synchronization;
and if the file content of the first configuration file package is inconsistent with the file content of the second configuration file package, outputting a version synchronization failure prompt.
4. The test environment verification method of claim 1, wherein the first verification object comprises a first database table, the second verification object comprises a second database table, and the invoking of the comparison tool compares the first verification object with the second verification object and outputs a comparison result comprises:
calling a structured query language to respectively count the data volume of the first database table and the data volume of the second database table;
if the data volume of the first database table is equal to the data volume of the database configuration table of the second test environment database, outputting a prompt of successful version synchronization;
and if the data volume of the first database table is not equal to the data volume of the second database table, outputting a version synchronization failure prompt.
5. The test environment verification method of claim 2, wherein the database configuration table includes a version number field, an address field, an interface field, a user field, a password field, and a profile packet field;
the searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction includes:
determining first configuration file packet information and second configuration file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first configuration file packet from the first testing environment database according to the version number field, the configuration file packet field and the first configuration file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second configuration file packet from the second testing environment database according to the version number field, the configuration file packet field and the second configuration file packet information.
6. The test environment verification method of claim 5, wherein the database configuration table further comprises a table name field, a first data volume field, and a second data volume field;
the searching and acquiring the first check object and the second check object from the database configuration table according to the check instruction includes:
determining first database table information and second database table information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first database table from the first testing environment database according to the table name field, the first data volume field and the first database table information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second database table from the second testing environment database according to the table name field, the second data volume field and the second database table information.
7. The test environment verification method of claim 6, wherein the database configuration table further comprises an ear file package field;
the searching and acquiring the first check object and the second check object from the database table according to the check instruction includes:
determining first ear file packet information and second ear file packet information according to the checking instruction;
searching an access address of the first testing environment database according to the address field and the interface field, accessing the access address of the first testing environment database according to the user field and the password field, and searching and acquiring a first ear file packet from the first testing environment database according to the version number field, the ear file packet field and the first ear file packet information;
and searching an access address of the second testing environment database according to the address field and the interface field, accessing the access address of the second testing environment database according to the user field and the password field, and searching and acquiring a second ear file packet from the second testing environment database according to the version number field, the ear file packet field and the second ear file packet information.
8. A test environment verification system, comprising:
the connection module is used for connecting the first test environment database and the second test environment database;
the acquisition module is used for acquiring a first check object from the first test environment database according to the check instruction and acquiring a second check object from the second test environment database;
and the comparison module is used for calling a comparison tool to compare the first check object with the second check object and outputting a comparison result.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the test environment verification method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a test environment verification method according to any one of claims 1 to 7.
CN202010127588.2A 2020-02-28 2020-02-28 Test environment verification method and system Pending CN111352997A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010127588.2A CN111352997A (en) 2020-02-28 2020-02-28 Test environment verification method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010127588.2A CN111352997A (en) 2020-02-28 2020-02-28 Test environment verification method and system

Publications (1)

Publication Number Publication Date
CN111352997A true CN111352997A (en) 2020-06-30

Family

ID=71197193

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010127588.2A Pending CN111352997A (en) 2020-02-28 2020-02-28 Test environment verification method and system

Country Status (1)

Country Link
CN (1) CN111352997A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035365A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Version deployment method and device supporting multiple test environments
CN113360404A (en) * 2021-06-30 2021-09-07 中国工商银行股份有限公司 Method and device for comparing metadata of database
CN113656312A (en) * 2021-08-19 2021-11-16 天津车之家数据信息技术有限公司 Test data generation method and device and computing equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035365A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Version deployment method and device supporting multiple test environments
CN112035365B (en) * 2020-09-01 2023-08-18 中国银行股份有限公司 Version deployment method and device supporting multiple test environments
CN113360404A (en) * 2021-06-30 2021-09-07 中国工商银行股份有限公司 Method and device for comparing metadata of database
CN113360404B (en) * 2021-06-30 2024-03-22 中国工商银行股份有限公司 Metadata comparison method and device for database
CN113656312A (en) * 2021-08-19 2021-11-16 天津车之家数据信息技术有限公司 Test data generation method and device and computing equipment

Similar Documents

Publication Publication Date Title
CN111352997A (en) Test environment verification method and system
CN106940695B (en) Data source information verification method and device
CN112631926B (en) Code test coverage rate display method and device, computer equipment and storage medium
CN108460068B (en) Method, device, storage medium and terminal for importing and exporting report
CN111858296B (en) Interface testing method, device, equipment and storage medium
CN111638983A (en) Interface calling method, interface calling device and terminal equipment
CN111737148A (en) Automatic regression testing method and device, computer equipment and storage medium
CN115292197A (en) Software testing method and device, electronic equipment and storage medium
CN113220597B (en) Test method, test device, electronic equipment and storage medium
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN111209184A (en) Automatic testing method and device and electronic equipment
CN110838929A (en) System error checking method and system error checking device
CN112256252B (en) Interface generation method and device, storage medium and electronic equipment
CN112561690A (en) Method, system, equipment and storage medium for testing credit card staging service interface
CN116737535A (en) Interface test method, device, computer equipment and storage medium
CN116414689A (en) Interface parameter verification method and system based on reflection mechanism
CN108255823B (en) Method and device for reading invoice information
CN114648323A (en) Service scene oriented call chain processing method, device and medium
CN113392024A (en) Method, device, equipment and medium for testing storage process
CN113760237A (en) Compiling address updating method and device, terminal equipment and readable storage medium
CN113641628A (en) Data quality detection method, device, equipment and storage medium
CN113238940A (en) Interface test result comparison method, device, equipment and storage medium
CN112052054A (en) Function calling method and device, electronic equipment and storage medium
CN114327377B (en) Method and device for generating demand tracking matrix, computer equipment and storage medium
CN112347095B (en) Data table processing method, device and server

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