Add GitHub Actions CI, nightly suite, and mocked-AWS CD pipeline - #18
Add GitHub Actions CI, nightly suite, and mocked-AWS CD pipeline#18devin-ai-integration[bot] wants to merge 3 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Runtime verification of the harness image (Devin testing run,
|
Summary
Adds a standard GitHub Actions setup for this Selenium/TestNG harness. Since the repo is a test framework rather than a service, "deployment" here means building a container of the harness and shipping it to ECR/ECS plus publishing reports — all against mocked AWS identifiers.
.github/workflows/ci.yml— push/PR tomain:mvn -B verify -DskipTests, POM+plugin resolution,xmllinton the suite XMLs, then a headless-Chrome smoke run. Caches~/.m2viasetup-java, uploads the jar,ExtentReports/**,target/surefire-reports/**,test-output/**..github/workflows/nightly.yml— cron30 2 * * *+workflow_dispatch(suite selectable), full suite, report artifacts, job summary..github/workflows/cd.yml+Dockerfile+deploy/ecs-task-definition.json— build image → ECR push → ECSregister-task-definition/run-task→ S3 report sync, staging then production behind a GitHub Environment approval gate, OIDC-only auth..github/dependabot.yml(maven / github-actions / docker),docs/CICD.md.Toolchain matched to the repo:
pom.xmltargets 1.8 bytecode but Selenium 4.25 needs a JDK 11+ toolchain, so CI runs Temurin 21 (what this was validated on) while still compiling to 1.8. Surefire's default suite is overridden per-workflow with-Dsurefire.suiteXmlFiles=.Suite scoping (deliberate, not papering over failures): the committed
suites/testng.xmlincludesFaceBookLoginTest, whose body ends inAssert.assertTrue(false, "Login failed : Test failed")— it can never pass, and it targets facebook.com. So PR/push CI runs a newsrc/test/resources/suites/smoke.xml(GoogleSearchTestonly) with nocontinue-on-error, keeping a red check meaningful. The nightly workflow runs the full suite and marks only that one stepcontinue-on-error: true, with an inline comment naming the known-failing test; artifacts and the job summary carry the real result. Both suites still hit public third-party sites, which hosted runners can reach — documented indocs/CICD.md.Driver resolution:
browser-actions/setup-chromeinstalls Chrome + a matching chromedriver and the path is fed to Maven, so WebDriverManager never downloads a driver:The image achieves the same offline property, which took three iterations to actually get right (each verified by building and running the container): the runtime must be a JDK (Surefire re-runs
testCompile), the runtime Maven must be the same version that primed~/.m2(different Maven versions bind different default lifecycle plugin versions, breaking-o), the priming layer must really execute the suite (surefire-testngis resolved only when tests run, so-Dmaven.test.skip.exec=trueleaves it missing), a Chrome-for-Testing chromedriver is baked into the Selenium cache, and the env var is namedHARNESS_MAVEN_ARGSbecause Maven 3.9 auto-consumesMAVEN_ARGS.Everything AWS is mocked. Account
123456789012,arn:aws:iam::123456789012:role/demo-*, ECRdemo/selenium-testng-harness, clustersdemo-staging-cluster/demo-prod-cluster, namespacesdemo-staging/demo-prod, bucketdemo-mock-test-reports,us-east-1— all supplied asvars.*with these fake defaults. The kill switch isvars.AWS_MOCK_MODE(defaults totrue):So under defaults the image is genuinely built (and uploaded as an artifact) while every push/ECS/S3 call only logs what it would do. No long-lived keys anywhere;
id-token: writeis granted only on deploy jobs, workflows are otherwisecontents: read, with concurrency groups and pinned action versions.Validation
actionlint 1.7.7— clean on all three workflows; all YAML/JSON parses.mvn -B -ntp verify -DskipTests,mvn validate dependency:resolve-plugins, andmvn -B test -Dsurefire.suiteXmlFiles=src/test/resources/suites/smoke.xml— pass locally.docker build --no-cache+docker runof the harness image — smoke suite executes offline and exits 0; a--network nonerun proves Maven and Chrome/chromedriver need no egress (only the test's owndriver.getfails). Full log in the verification comment.Caveat — pre-existing flake:
GoogleSearchTestfailed 4 of 11 runs inside a container (Google interstitial →Title doesn't contain abc), 0 of 6 on the host. CI/nightly/ECS runs will therefore go red intermittently; documented indocs/CICD.md. The durable fix is aWebDriverWaitin the test, deliberately not changed here.Not verifiable in the sandbox: the workflows actually executing on GitHub Actions (only static
actionlintvalidation was possible before merge) and the CD pipeline against real AWS, which is mock-only by design.Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/59d8a4701eba4ac087e9fc5100dd7c0c
Requested by: @mbatchelor81