-
Notifications
You must be signed in to change notification settings - Fork 6
Enhanced CI/CD, Configuration Management & Dependency Updates #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the CI/CD pipeline, updates core dependencies, and introduces a centralized test configuration system to improve parallel test execution, retry logic, and resource cleanup.
- Updated GitHub Actions for matrix builds, caching, environment validation, artifact retention, and cleanup.
- Centralized test settings via a new
TestConfiguration
class and applied across driver management and REST services. - Upgraded key dependencies (Spring Boot, Cucumber, Logback, AssertJ) and added Jackson, Jakarta Annotations, and Awaitility.
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
wikipedia/src/test/resources/suite/WikipediaSuiteTest.xml | Updated suite name, enabled parallel methods execution, renamed test. |
wikipedia/src/test/java/com/cmccarthy/ui/utils/DriverWait.java | Added suppression for unused warnings. |
wikipedia/src/test/java/com/cmccarthy/ui/utils/DriverManager.java | Injected TestConfiguration , managed headless mode, window sizing, and cleanup. |
wikipedia/src/test/java/com/cmccarthy/ui/step/Hooks.java | Simplified driver teardown by calling quitDriver() . |
wikipedia/src/test/java/com/cmccarthy/ui/config/WikipediaContextConfiguration.java | Reformatted @ComponentScan for clarity. |
weather/src/test/resources/suite/WeatherSuiteTest.xml | Updated suite name, enabled parallel methods execution, renamed test. |
weather/src/test/java/com/cmccarthy/api/service/WeatherService.java | Refactored to use retry-enabled REST calls via RestService . |
pom.xml | Bumped Spring Boot, Cucumber, Logback, AssertJ, Maven plugin versions; added new dependencies. |
common/src/main/resources/downloadDriver.sh | Removed legacy driver-download script. |
common/src/main/resources/application-headless-github.properties | Added comprehensive test, API, and UI configuration properties. |
common/src/main/java/com/cmccarthy/common/utils/StringUtil.java | Replaced Apache utility with secure random string generators. |
common/src/main/java/com/cmccarthy/common/utils/DateTimeUtil.java | Switched legacy switch to modern switch expressions. |
common/src/main/java/com/cmccarthy/common/utils/Constants.java | Removed obsolete driver and resource directory constants. |
common/src/main/java/com/cmccarthy/common/utils/ApplicationProperties.java | Added Lombok getters and cleaned up manual getters/setters. |
common/src/main/java/com/cmccarthy/common/service/RestService.java | Introduced configurable RestAssured settings, retry logic, and HTTP methods. |
common/src/main/java/com/cmccarthy/common/config/TestConfiguration.java | Added centralized test configuration with nested classes for API, UI, and parallel settings. |
.github/workflows/run.yml | Enhanced CI workflow with matrix strategy, caching, concurrency control, and cleanup. |
Comments suppressed due to low confidence (1)
.github/workflows/run.yml:10
- The
concurrency
block appears indented underon
; it should be a top-level key in the workflow, not nested underon
, to take effect.
concurrency:
import org.springframework.context.annotation.Configuration; | ||
|
||
@Setter | ||
@Getter | ||
@Configuration |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spring Boot may not bind @ConfigurationProperties
on a scanned @Configuration
class without enabling it; consider adding @EnableConfigurationProperties(TestConfiguration.class)
in your test context or using @ConfigurationPropertiesScan
.
import org.springframework.context.annotation.Configuration; | |
@Setter | |
@Getter | |
@Configuration | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
@Setter | |
@Getter | |
@Configuration | |
@EnableConfigurationProperties(TestConfiguration.class) |
Copilot uses AI. Check for mistakes.
.get(applicationProperties.getWeatherAppUrl()); | ||
|
||
final RequestSpecification requestSpecification = restService.getRequestSpecification().param("q", location) | ||
.param("appid", "0a1b11f110d4b6cd43181d23d724cb94"); |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The API key is hard-coded in the test service; consider externalizing it into application.properties
or TestConfiguration
to avoid leaking credentials.
Copilot uses AI. Check for mistakes.
public void setLocalWebDriver() throws IOException { | ||
switch (applicationProperties.getBrowser()) { | ||
public void setLocalWebDriver() { | ||
String browser = applicationProperties.getBrowser(); |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The browser is read from ApplicationProperties
but there’s a defaultBrowser
in TestConfiguration
; consider using testConfig.getDefaultBrowser()
for consistency.
String browser = applicationProperties.getBrowser(); | |
String browser = testConfig.getDefaultBrowser(); |
Copilot uses AI. Check for mistakes.
.accept("application/json"); | ||
} | ||
|
||
@Retryable(value = {Exception.class}, maxAttempts = 3, backoff = @Backoff(delay = 1000)) |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retry maxAttempts is hard-coded to 3; consider using testConfiguration.getApi().getMaxRetries()
to keep retry settings in sync with the centralized configuration.
@Retryable(value = {Exception.class}, maxAttempts = 3, backoff = @Backoff(delay = 1000)) | |
@Retryable(value = {Exception.class}, maxAttemptsExpression = "#{@restService.getMaxAttempts()}", backoff = @Backoff(delay = 1000)) |
Copilot uses AI. Check for mistakes.
for (int i = 0; i < length; i++) { | ||
int digit = ThreadLocalRandom.current().nextInt(min, max + 1) % 10; | ||
sb.append(digit); | ||
} |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Using % 10
after nextInt(min, max + 1)
is redundant and could introduce bias; you can directly bound the random digit with ThreadLocalRandom.current().nextInt(0,10)
or between min
and max
without modulo.
for (int i = 0; i < length; i++) { | |
int digit = ThreadLocalRandom.current().nextInt(min, max + 1) % 10; | |
sb.append(digit); | |
} | |
for (int i = 0; i < length; i++) { | |
int digit = ThreadLocalRandom.current().nextInt(min, max + 1); | |
sb.append(digit); | |
} |
Copilot uses AI. Check for mistakes.
Summary of Changes
The changes include significant improvements to the Spring Cucumber TestNG parallel test harness:
🔧 GitHub Actions Workflow Updates (run.yml)
📦 Dependency Updates (pom.xml)
🏗️ New Configuration System
🔄 Service Layer Improvements
🧪 Test Infrastructure Enhancements
🧹 Code Quality Improvements
🗑️ Cleanup
📊 Testing Improvements