CI/CD Integration
Prerequisites#
Perform a one time setup before you continue with CI/CD integration.
CI/CD Integration#
The Drill4Net agent should run after the build step in CI/CD pipeline:
1. Update Build Version in Configurations#
Each build should update build version in Drill4Net Scanner and Drill4Net Injector configuration files.
- Update
adminAgentConfig:buildVersionin Drill4Net Scanner appsettings.yml to version of current build. - Update
AdminAgentConfig:BuildVersionin Drill4Net Injector drill4netsettings.yml to version of current build.
2. Run Drill4Net Scanner#
After each build, you should run Drill4Net Scanner for application under test assembly.
3. Run Drill4Net Injector#
After each build, you should run Drill4Net Injector for assembly with tests.
4. Run Tests#
After Drill4Net Scanner and Drill4Net Injector finished work, you should run tests from assembly provided to Drill4Net Injector.
5. Get Tests to Run#
You can execute the curl command to get tests to run:
drill4j-address is the address of Drill4J Admin, for example http://localhost:8091.
agent-id is the value of adminAgentConfig:id provided in Drill4Net Scanner earlier.
To cover new build's Risks (methods modified since previous build) it is enough to only run tests returned in thr response.
6. Creating Environment Variable for SessionId#
When running a bunch of tests on different machines, it's essential to maintain consistency in test sessions. To achieve this, you can set up a unique session identifier using environment variables. The value for this environment variable can be any string, but it's important to ensure its uniqueness for proper session tracking. Ensure that you maintain this session ID consistency across all test machines.