-
Notifications
You must be signed in to change notification settings - Fork 467
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
Demo: Upgrade automation project #30480
Changes from 1 commit
f37e674
2865bef
a57317f
4429bd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
networks: | ||
http_net: | ||
db_net: | ||
es_net: | ||
|
||
volumes: | ||
cms-shared: | ||
dbdata: | ||
esdata: | ||
|
||
services: | ||
elasticsearch: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1 | ||
environment: | ||
- cluster.name=elastic-cluster | ||
- discovery.type=single-node | ||
- data | ||
- bootstrap.memory_lock=true | ||
- "ES_JAVA_OPTS=-Xmx1G " | ||
#ports: | ||
#- 9200:9200 | ||
#- 9600:9600 | ||
volumes: | ||
- esdata:/usr/share/elasticsearch/data | ||
networks: | ||
- es_net | ||
|
||
dotcms: | ||
image: ${docker_tag} | ||
environment: | ||
"CATALINA_OPTS": ' -Xms1g -Xmx1g ' | ||
"DB_BASE_URL": "jdbc:postgresql://db/dotcms" | ||
"DB_USERNAME": 'dotcmsdbuser' | ||
"DB_PASSWORD": 'password' | ||
"DOT_ES_AUTH_BASIC_PASSWORD": 'admin' | ||
"DOT_INITIAL_ADMIN_PASSWORD": "admin" | ||
"DOT_ES_ENDPOINTS": 'http://elasticsearch:9200' | ||
"CUSTOM_STARTER_URL": ${custom_starter} | ||
|
||
"DOT_CIRCUIT_BREAKER_MAX_CONN_TOTAL": "3" | ||
|
||
#EDIT CONTENT | ||
"DOT_CONTENT_EDITOR2_ENABLED": "true" | ||
"DOT_CONTENT_EDITOR2_CONTENT_TYPE" : "true" | ||
"DOT_FEATURE_FLAG_NEW_EDIT_PAGE": "true" | ||
|
||
depends_on: | ||
- elasticsearch | ||
- db | ||
volumes: | ||
- cms-shared:/data/shared | ||
#- [serverpath]/license.zip:/data/shared/assets/license.zip | ||
networks: | ||
- db_net | ||
- es_net | ||
ports: | ||
- "8080:8080" | ||
- "8443:8443" | ||
|
||
db: | ||
image: postgres:15 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unable to use this since the version that we are trying to upgrade is not compatible with this pg version (dotcms/dotcms:23.10.24_lts_v17_8b0be94) |
||
command: postgres -c 'max_connections=400' -c 'shared_buffers=128MB' | ||
environment: | ||
"POSTGRES_USER": 'dotcmsdbuser' | ||
"POSTGRES_PASSWORD": 'password' | ||
"POSTGRES_DB": 'dotcms' | ||
volumes: | ||
- dbdata:/var/lib/postgresql/data | ||
networks: | ||
- db_net | ||
ports: | ||
- "15432:5432" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"devDependencies": { | ||
"@types/node": "^22.7.5" | ||
}, | ||
"dependencies": { | ||
"@playwright/test": "^1.48.1", | ||
"dotenv": "^16.4.5" | ||
}, | ||
"type": "module" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
testDir: './', | ||
timeout: 60000, | ||
use: { | ||
headless: false, | ||
browserName: 'chromium' // Browser to use (chromium, firefox, webkit) | ||
}, | ||
testMatch: '**/*.spec.js' // Pattern to match test files | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import * as dotenv from 'dotenv'; | ||
|
||
|
||
dotenv.config({ path: 'properties/config.properties' }); | ||
|
||
const serverURL = process.env.BASE_URL; | ||
async function login(page) { | ||
test.setTimeout(40000); | ||
|
||
await page.goto(`${serverURL}/c`); | ||
|
||
let title = await page.title(); | ||
expect(title).toBe('dotCMS Content Management Platform'); | ||
await page.getByTestId('header').isVisible(); | ||
await page.fill('input[id="inputtext"]', '[email protected]'); | ||
await page.fill('input[id="password"]', 'admin'); | ||
await page.getByTestId('submitButton').click(); | ||
await page.waitForURL(`${serverURL}/dotAdmin/#/starter`); | ||
|
||
title = await page.title(); | ||
console.log('Page title after login:', title); | ||
expect(title).toBe('Welcome - dotCMS Content Management Platform'); | ||
} | ||
|
||
test('Verify dotCMS UI is running and ready', async ({ page }) => { | ||
await login(page); | ||
}); | ||
|
||
// Second test that makes a reindex after logging in | ||
test('Make a reindex', async ({ page }) => { | ||
test.setTimeout(60000); | ||
await login(page); | ||
|
||
// Open the settings menu | ||
await page.getByText('settingsSettingsarrow_drop_up').click(); | ||
await page.getByRole('link', { name: 'Maintenance' }).click(); | ||
|
||
// Switch to the relevant frame and click the 'Index' tab | ||
await page.frameLocator('iframe[name="detailFrame"]').getByRole('tab', { name: 'Index' }).click(); | ||
await page.locator('iframe[name="detailFrame"]').contentFrame().locator('#live_20241017194349Row').getByRole('cell', { name: 'Active' }).isVisible(); | ||
|
||
// Wait for the dialog to appear and accept it | ||
page.once('dialog', async dialog => { | ||
//console.log(`Dialog message: ${dialog.message()}`); | ||
await dialog.accept('2'); // Accept the dialog | ||
}); | ||
|
||
// Click the Reindex button in the iframe | ||
await page.frameLocator('iframe[name="detailFrame"]').getByLabel('Reindex', { exact: true }).click(); | ||
|
||
await page.waitForTimeout(3000); // Wait for 3 seconds | ||
|
||
// Verify that the reindexing message is visible | ||
await expect(page.locator('iframe[name="detailFrame"]').contentFrame().getByText('A full reindex is in progress.')).toBeVisible(); | ||
await expect(page.locator('iframe[name="detailFrame"]').contentFrame().getByText('A full reindex is in progress.')).toBeHidden({ timeout: 60000 }); | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import * as dotenv from 'dotenv'; | ||
|
||
|
||
dotenv.config({ path: 'properties/config.properties' }); | ||
|
||
|
||
const serverURL = process.env.BASE_URL; | ||
test('Verify dotCMS UI is running and ready', async ({ page }) => { | ||
test.setTimeout(60000); | ||
await page.goto(`${serverURL}/c`); | ||
|
||
let title = await page.title(); | ||
console.log('Page title before login:', title); | ||
expect(title).toBe('dotCMS Content Management Platform'); | ||
await page.getByTestId('header').isVisible(); | ||
|
||
await page.fill('input[id="inputtext"]', '[email protected]'); | ||
await page.fill('input[id="password"]', 'admin'); | ||
await page.getByTestId('submitButton').click(); | ||
await page.waitForURL("http://localhost:8080/dotAdmin/#/starter"); | ||
|
||
title = await page.title(); | ||
console.log('Page title after login:', title); | ||
expect(title).toBe('Welcome - dotCMS Content Management Platform'); | ||
}); | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[TEST1] | ||
# Version to upgrade from | ||
docker_tag_from=dotcms/dotcms:23.10.24_lts_v17_8b0be94 | ||
|
||
# Version to upgrade to | ||
docker_tag_to=dotcms/dotcms:trunk_3f68810 | ||
expected_db_version=241016 | ||
|
||
# Provice custom starter URL if is needed | ||
custom_starter=https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20240807/starter-20240807.zip | ||
|
||
|
||
[PLAYWRIGHT] | ||
# PLAYRIGHT Properties | ||
BASE_URL=http://localhost:8080 | ||
[email protected] | ||
password=admin |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"status": "passed", | ||
"failedTests": [] | ||
} |
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.
switch from elasticsearch to
image: opensearchproject/opensearch:1