CI/CD Integration
#
PrerequisitesPerform a one time setup before you continue with CI/CD integration.
#
CI/CD IntegrationThe Drill4Net agent should run after the build step in CI/CD pipeline:
#
1. Update Build Version in ConfigurationsEach build should update build version in Drill4Net Scanner and Drill4Net Injector configuration files.
- Update
adminAgentConfig:buildVersion
in Drill4Net Scanner appsettings.yml to version of current build. - Update
AdminAgentConfig:BuildVersion
in Drill4Net Injector drill4netsettings.yml to version of current build.
#
2. Run Drill4Net ScannerAfter each build, you should run Drill4Net Scanner for application under test assembly.
#
3. Run Drill4Net InjectorAfter each build, you should run Drill4Net Injector for assembly with tests.
#
4. Run TestsAfter Drill4Net Scanner and Drill4Net Injector finished work, you should run tests from assembly provided to Drill4Net Injector.
#
5. Get Tests to RunYou 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 SessionIdWhen 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.