Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
388228e
changing java 17 and ignorning other runs
Satish-Pothabathula Apr 1, 2026
bd7b28d
changing java 17 and ignorning other runs
Satish-Pothabathula Apr 1, 2026
8e10673
changing java 17 and ignorning other runs
Satish-Pothabathula Apr 1, 2026
8a0e749
adding chnages tow ait for test
Satish-Pothabathula Apr 1, 2026
59cb0f4
adding chnages tow ait for test
Satish-Pothabathula Apr 1, 2026
f3d60c3
adding chnages tow ait for test
Satish-Pothabathula Apr 1, 2026
a979cf4
adding chnages tow ait for test
Satish-Pothabathula Apr 1, 2026
1be56fa
adding it tests back
Satish-Pothabathula Apr 1, 2026
7c01b32
adding it tests back
Satish-Pothabathula Apr 2, 2026
23b2502
adding it tests back
Satish-Pothabathula Apr 2, 2026
b1ceb0a
adding it tests back
Satish-Pothabathula Apr 2, 2026
cdfe966
removing unnesscary changes
Satish-Pothabathula Apr 2, 2026
d8a41ce
removing unnesscary changes
Satish-Pothabathula Apr 3, 2026
34ece5e
testing
Satish-Pothabathula Apr 3, 2026
dd64794
testing
Satish-Pothabathula Apr 3, 2026
aac76c9
testing
Satish-Pothabathula Apr 6, 2026
d78f118
testing
Satish-Pothabathula Apr 6, 2026
8a5ba17
testing
Satish-Pothabathula Apr 6, 2026
0b4e3a9
testing
Satish-Pothabathula Apr 6, 2026
0eee551
Revert "testing"
Satish-Pothabathula Apr 6, 2026
b340792
Revert "testing"
Satish-Pothabathula Apr 6, 2026
765813e
Revert "testing"
Satish-Pothabathula Apr 6, 2026
acbb6f9
Revert "testing"
Satish-Pothabathula Apr 6, 2026
159fccd
Revert "adding it tests back"
Satish-Pothabathula Apr 6, 2026
d129fd8
adding IT tests back
Satish-Pothabathula Apr 6, 2026
895d9a5
adding IT tests back logic
Satish-Pothabathula Apr 6, 2026
0d3c379
adding IT tests back logic fix
Satish-Pothabathula Apr 6, 2026
ebcdac0
cleanup
Satish-Pothabathula Apr 6, 2026
8e6d3ea
cleanup
Satish-Pothabathula Apr 6, 2026
2a43b5f
master (#1066)
Satish-Pothabathula Apr 6, 2026
0609ba1
master merge
Satish-Pothabathula Apr 7, 2026
090eaa3
Merge remote-tracking branch 'origin/LTS-test-failure' into LTS-test-…
Satish-Pothabathula Apr 7, 2026
a028090
cleanup
Satish-Pothabathula Apr 7, 2026
6784450
cleanup
Satish-Pothabathula Apr 7, 2026
4e9379e
cleanup
Satish-Pothabathula Apr 7, 2026
46f1c25
add a logic of ui.test to wait until IT complete
Satish-Pothabathula Apr 7, 2026
2b20164
Revert "add a logic of ui.test to wait until IT complete"
Satish-Pothabathula Apr 7, 2026
894fa83
chrome isssue in ui.test fix
Satish-Pothabathula Apr 7, 2026
2728dae
cleanup
Satish-Pothabathula Apr 7, 2026
c447c45
updating the image
Satish-Pothabathula Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 147 additions & 20 deletions .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,73 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
'use strict';

const { execFileSync } = require('child_process');
const { URLSearchParams } = require('url');
const ci = new (require('./ci.js'))();

function sleepSeconds(seconds) {
execFileSync('bash', ['-lc', `sleep ${seconds}`], { stdio: 'inherit' });
}

// Driver version must match installed Chrome; prefer google-chrome --version over chromedriver on PATH.
function getChromeDriverVersionForSelenium() {
try {
const out = execFileSync('bash', [
'-lc',
'google-chrome --version 2>/dev/null || google-chrome-stable --version 2>/dev/null || chromium-browser --version 2>/dev/null || true'
], { encoding: 'utf8' });
const m = String(out).match(/(\d+\.\d+\.\d+\.\d+)/);
if (m) {
return m[1];
}
} catch (e) {
// ignore
}
let chromedriver = ci.sh('chromedriver --version', true);
chromedriver = chromedriver.split(' ');
return chromedriver.length >= 2 ? chromedriver[1] : '';
}

/** Allow /apps/cif-components-examples/graphql through SlingAuthenticator (matches ui.tests + IT CommerceTestBase). */
function postSlingAuthenticatorForExamplesGraphql() {
const params = new URLSearchParams();
params.append('apply', 'true');
params.append('action', 'ajaxConfigManager');
params.append('_charset_', 'utf-8');
params.append('propertylist', [
'auth.sudo.cookie',
'auth.sudo.parameter',
'auth.annonymous',
'sling.auth.requirements',
'sling.auth.anonymous.user',
'sling.auth.anonymous.password',
'auth.http',
'auth.http.realm',
'auth.uri.suffix'
].join(','));
params.append('auth.sudo.cookie', 'sling.sudo');
params.append('auth.sudo.parameter', 'sudo');
params.append('auth.annonymous', 'false');
['+/', '-/libs/granite/core/content/login', '-/etc.clientlibs', '-/etc/clientlibs/granite',
'-/libs/dam/remoteassets/content/loginerror', '-/apps/cif-components-examples/graphql'
].forEach((entry) => params.append('sling.auth.requirements', entry));
params.append('sling.auth.anonymous.user', '');
params.append('sling.auth.anonymous.password', 'unmodified');
params.append('auth.http', 'preemptive');
params.append('auth.http.realm', 'Sling+(Development)');
params.append('auth.uri.suffix', '/j_security_check');

const body = params.toString();
execFileSync('curl', [
'-sS', '-u', 'admin:admin',
'-X', 'POST',
'http://localhost:4502/system/console/configMgr/org.apache.sling.engine.impl.auth.SlingAuthenticator',
'-H', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',
'-H', 'Origin: http://localhost:4502',
'--data-binary', body
], { stdio: 'inherit' });
}

ci.context();

ci.stage('Project Configuration');
Expand All @@ -27,19 +92,18 @@ const buildPath = '/home/circleci/build';
const { TYPE, BROWSER, AEM } = process.env;

try {
ci.stage("Integration Tests");
ci.stage(`AEM IT (${TYPE}, AEM=${AEM})`);
let wcmVersion = ci.sh('mvn help:evaluate -Dexpression=core.wcm.components.version -q -DforceStdout', true);
let magentoGraphqlVersion = ci.sh('mvn help:evaluate -Dexpression=magento.graphql.version -q -DforceStdout', true);
let excludedCategory = AEM === 'classic' ? 'junit.category.IgnoreOn65' : 'junit.category.IgnoreOnCloud';

// TODO: Remove when https://jira.corp.adobe.com/browse/ARTFY-6646 is resolved
let aemCifSdkApiVersion = "2025.09.02.1-SNAPSHOT";

let aemCifSdkApiVersion = "2025.12.04.00";

ci.dir(qpPath, () => {
// Connect to QP
ci.sh('./qp.sh -v bind --server-hostname localhost --server-port 55555');

// Download latest add-on release from artifactory
let extras = '';
const downloadArtifact = (artifactId, type, outputFileName, version = 'LATEST', classifier = '') => {
Expand All @@ -60,7 +124,8 @@ try {
downloadArtifact('cif-cloud-ready-feature-pkg', 'far', 'addon.far', 'LATEST', 'cq-commerce-addon-authorfar');
}

const maxMetaspace = AEM == 'lts' ? '-XX:MaxMetaspaceSize=512m' : '-XX:MaxPermSize=256m';
const jvmHeap = AEM === 'lts' ? '-Xmx2048m' : '-Xmx1536m';
const maxMetaspace = AEM === 'lts' ? '-XX:MaxMetaspaceSize=512m' : '-XX:MaxPermSize=256m';
// Start CQ
ci.sh(`./qp.sh -v start --id author --runmode author --port 4502 --qs-jar /home/circleci/cq/author/cq-quickstart.jar \
--bundle org.apache.sling:org.apache.sling.junit.core:1.0.23:jar \
Expand All @@ -77,51 +142,113 @@ try {
${ci.addQpFileDependency(config.modules['core-cif-components-examples-config'])} \
${ci.addQpFileDependency(config.modules['core-cif-components-examples-content'])} \
${ci.addQpFileDependency(config.modules['core-cif-components-it-tests-content'])} \
--vm-options \\\"-Xmx1536m ${maxMetaspace} -Djava.awt.headless=true -javaagent:${process.env.JACOCO_AGENT}=destfile=crx-quickstart/jacoco-it.exec\\\"`);
--vm-options \\\"${jvmHeap} ${maxMetaspace} -Djava.awt.headless=true -javaagent:${process.env.JACOCO_AGENT}=destfile=crx-quickstart/jacoco-it.exec\\\"`);
});

// LTS: require two consecutive good login polls, then settle (commerce/GraphQL still starting after first 200).
if (AEM === 'lts') {
ci.stage('Wait for stable AEM HTTP (LTS)');
const waitLogin = [
'ok=0',
'i=0',
'while [ "$i" -lt 72 ]; do',
' i=$((i + 1))',
' code=$(curl -s -o /dev/null -w "%{http_code}" -u admin:admin http://localhost:4502/libs/granite/core/content/login.html) || code=000',
' if [ "$code" = "200" ] || [ "$code" = "302" ]; then',
' ok=$((ok + 1))',
' echo "AEM HTTP $code (consecutive OK: $ok, poll $i/72)"',
' if [ "$ok" -ge 2 ]; then echo "AEM login endpoint stable"; break; fi',
' else',
' ok=0',
' fi',
' sleep 10',
'done',
'if [ "$ok" -lt 2 ]; then echo "AEM login did not stabilize in time"; exit 1; fi',
'echo "LTS settle: OSGi / commerce / GraphQL (90s)..."',
'sleep 90'
].join('\n');
execFileSync('bash', ['-lc', waitLogin], { stdio: 'inherit' });
}

// Temporary fix for integration & selenium test
const formData = {
apply: true,
factoryPid: 'com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl',
action: 'ajaxConfigManager',
url: "http://localhost:4502/apps/cif-components-examples/graphql",
identifier: 'examples',
url: 'http://localhost:4502/apps/cif-components-examples/graphql',
httpMethod: 'GET',
propertylist: 'url,httpMethod'
allowHttpProtocol: 'true',
acceptSelfSignedCertificates: 'true',
propertylist: 'identifier,url,httpMethod,allowHttpProtocol,acceptSelfSignedCertificates'
};

ci.sh(`curl 'http://localhost:4502/system/console/configMgr/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~examples' \
ci.sh(`curl -sS 'http://localhost:4502/system/console/configMgr/com.adobe.cq.commerce.graphql.client.impl.GraphqlClientImpl~examples' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'Origin: http://localhost:4502' \
-u 'admin:admin' \
--data-raw '${Object.entries(formData)
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
.join('&')}'`);

ci.stage('SlingAuthenticator (mock GraphQL path)');
postSlingAuthenticatorForExamplesGraphql();

if (AEM === 'lts') {
ci.stage('LTS: settle after GraphQL + SlingAuthenticator (60s)');
sleepSeconds(60);
}

// Run integration tests
// Integration tests (Sling HTTP ITs); LTS retries on flake
if (TYPE === 'integration') {
ci.dir('it/http', () => {
ci.sh(`mvn clean verify -U -B \
const mvnIt = `mvn clean verify -U -B \
-Ptest-all \
-Dexclude.category=${excludedCategory} \
-Dsling.it.instance.url.1=http://localhost:4502 \
-Dsling.it.instance.runmode.1=author \
-Dsling.it.instances=1`);
-Dsling.it.instances=1`;
const maxItAttempts = AEM === 'lts' ? 3 : 1;
ci.dir('it/http', () => {
for (let attempt = 1; attempt <= maxItAttempts; attempt++) {
try {
ci.sh(mvnIt);
return;
} catch (err) {
if (attempt >= maxItAttempts) {
throw err;
}
ci.stage(`Integration tests failed (attempt ${attempt}/${maxItAttempts}) — retry after 90s`);
sleepSeconds(90);
}
}
});
}

// Run UI tests
if (TYPE === 'selenium') {
// Get version of ChromeDriver
let chromedriver = ci.sh('chromedriver --version', true); // Returns something like ChromeDriver 80.0.3987.16 (320f6526c1632ad4f205ebce69b99a062ed78647-refs/branch-heads/3987@{#185})
chromedriver = chromedriver.split(' ');
chromedriver = chromedriver.length >= 2 ? chromedriver[1] : '';
const chromedriver = getChromeDriverVersionForSelenium();
const chromedriverEnv = chromedriver ? `CHROMEDRIVER=${chromedriver} ` : '';
if (chromedriver) {
console.log(`UI tests: CHROMEDRIVER=${chromedriver} (aligned with Chrome when possible)`);
} else {
console.log('UI tests: CHROMEDRIVER unset — selenium-standalone will resolve driver');
}

ci.dir('ui.tests', () => {
ci.sh(`CHROMEDRIVER=${chromedriver} mvn test -U -B -Pui-tests-local-execution -DHEADLESS_BROWSER=true -DSELENIUM-BROWSER=${BROWSER}`);
const nodeOpts = AEM === 'lts' ? 'NODE_OPTIONS=--max-old-space-size=4096 ' : '';
const mvnUi = `${nodeOpts}${chromedriverEnv}mvn test -U -B -Pui-tests-local-execution -DHEADLESS_BROWSER=true -DSELENIUM-BROWSER=${BROWSER}`;
const maxAttempts = AEM === 'lts' ? 3 : 1;
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
try {
ci.sh(mvnUi);
return;
} catch (err) {
if (attempt >= maxAttempts) {
throw err;
}
ci.stage(`UI tests failed (attempt ${attempt}/${maxAttempts}) — retry after 90s`);
sleepSeconds(90);
}
}
});
}

Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ executors:
docker:
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.7-openjdk21
<<: *docker_auth
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-lts:6.6.0-openjdk21
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem-lts:6.6.1-openjdk21
<<: *docker_auth

jobs:
Expand Down
2 changes: 2 additions & 0 deletions ui.tests/test-module/wdio.conf.commons.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const log4js = require('log4js');
exports.config = {
runner: 'local',

maxInstances: 1,

// Tests
specs: [
'./specs/**/*.js'
Expand Down
10 changes: 9 additions & 1 deletion ui.tests/test-module/wdio.conf.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* DO NOT MODIFY
* Local WDIO overrides (browser, selenium-standalone). Shared defaults: wdio.conf.commons.js
*/
let wdio_config = require('./wdio.conf.commons.js').config;
let config = require('./lib/config');
Expand Down Expand Up @@ -61,7 +62,14 @@ case config.CHROME:
}
};
if (config.selenium.headless === true) {
capabilities['goog:chromeOptions'].args = ['headless'];
// Linux CI: sandbox + default /dev/shm often breaks headless Chrome
capabilities['goog:chromeOptions'].args = [
'headless',
'--no-sandbox',
'--disable-dev-shm-usage',
'--disable-gpu',
'--window-size=1920,1080'
];
}
break;
case config.FIREFOX:
Expand Down