Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
07fc2b9
Add a standardized way of managing a machine tree for selection of a …
iTerminate Oct 26, 2026
63ce077
Add standard scroll panel for machine selection.
iTerminate Oct 27, 2026
7710654
Utilize the new standardized functionality with ioc machine parent se…
iTerminate Oct 27, 2026
6ad240c
Add model that drives the UI for the machine selection when updating …
iTerminate Oct 27, 2026
35e4688
Add functionality that allows updating the housing assignment from th…
iTerminate Oct 27, 2026
704b29a
Add supporting views for the inventory housing selection.
iTerminate Oct 27, 2026
5f232d2
Add a new top level to test swapping catalog item
iTerminate Oct 27, 2026
1a65181
Add a new inventory assignment acceptance test.
iTerminate Oct 27, 2026
faa6cc3
Improve test reliablity when panels might be collapsed
iTerminate Oct 27, 2026
808cf75
add docs about the new acceptance test
iTerminate Oct 27, 2026
80bd1f3
Improve test reliablity
iTerminate Oct 27, 2026
01db68d
Resolve headless tests
iTerminate Oct 27, 2026
bec5a03
Refactor the tests into modules by domain
iTerminate Oct 27, 2026
a1eefee
Display Assigned item column in the selection of housing parent from …
iTerminate Oct 27, 2026
58abbb6
Enable filtering of housing column from catalog details page.
iTerminate Oct 27, 2026
ed4bab9
Audit test suite maven deps to match the libs of the portal
iTerminate Oct 27, 2026
0667d38
Improve reliablity of preparing the build for test
iTerminate Oct 27, 2026
f17858e
Use the standard session utility
iTerminate Oct 27, 2026
d5aefd5
Add tests for the inventory functioanlity added
iTerminate Oct 27, 2026
d85ff03
integrate with github runner
iTerminate Oct 27, 2026
8d67a1b
update git ignore
iTerminate Oct 27, 2026
b36e094
chance accessebility for test purposes.
iTerminate Oct 27, 2026
7ffc7ed
Changes for the test suite integration
iTerminate Oct 27, 2026
dfbea79
Add unit tests for new invenotry functionality for changing housing f…
iTerminate Oct 27, 2026
30504dd
Resolve some common issues with tests
iTerminate Oct 27, 2026
8109fed
further improve reliablility
iTerminate Oct 27, 2026
1545570
further improve reliablility
iTerminate Oct 27, 2026
fec4b27
Update docs for testing api.
iTerminate Oct 27, 2026
637ca0f
Default to run tests headless now
iTerminate Oct 27, 2026
dbef60b
Update the global CDB test script to work in the updated enviornment.
iTerminate Oct 27, 2026
668201a
Further improve reliablity.
iTerminate Oct 27, 2026
7339798
Document test requirements
iTerminate Oct 27, 2026
144b7de
Rerun 1 time if failed.
iTerminate Oct 27, 2026
62fd985
Update docs
iTerminate Oct 27, 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
44 changes: 44 additions & 0 deletions .github/workflows/test-cdbportal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test CDB Portal

on:
pull_request:
paths:
- 'src/java/CdbWebPortal/src/java/**'
- 'tools/developer_tools/code_testing/CdbWebPortalTest/**'
- '.github/workflows/test-cdbportal.yml'
workflow_dispatch:

permissions:
contents: read

jobs:
test:
name: Run CDB Portal Java Tests
runs-on: ubuntu-latest

defaults:
run:
working-directory: tools/developer_tools/code_testing/CdbWebPortalTest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11 and Maven cache
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'
cache: maven
cache-dependency-path: tools/developer_tools/code_testing/CdbWebPortalTest/pom.xml

- name: Run tests
run: mvn --batch-mode --no-transfer-progress test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: cdb-portal-test-results
path: tools/developer_tools/code_testing/CdbWebPortalTest/target/surefire-reports/
if-no-files-found: warn
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ docs/python/_build/

# Temporary testing csv files
tools/developer_tools/python-client/packages/cli/cdbCli/service/cli/Spreadsheets/
/tools/developer_tools/portal_testing/PythonSeleniumTest/conda-env
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ mvn test -Dtest=ClassName#methodName # single test

# Python API tests — require the portal to be running on localhost:8080
cd tools/developer_tools/python-client && ./generatePyClient.sh http://localhost:8080/cdb
cd tools/developer_tools/python-client/test && pytest api_test.py
pytest api_test.py::TestClass::test_method # single test
cd tools/developer_tools/python-client && pytest test/
pytest test/item_test.py::ItemTest::test_method # single test

# Selenium GUI tests
cd tools/developer_tools/portal_testing/PythonSeleniumTest && pytest gui_test.py
Expand Down Expand Up @@ -127,7 +127,7 @@ MariaDB 10.5. Authoritative schema is the set of `create_cdb_tables.sql`, `creat
- **`cdb` vs `cdb_dev`**: every db, deploy, undeploy, and backup target has a `-dev` variant that targets a separate database name and Payara domain, so a developer can run both side-by-side. When adding new admin scripts, follow the same pattern (first arg is DB name, defaulting to `cdb`).
- **Single canonical version string**: run `make prepare-release` (`sbin/cdb_prepare_release.py`) to bump `etc/version`, `openapi.yaml`, the web `?v=` cache-busters, the python-client `packages/*/pyproject.toml`/conda recipes, and scaffold `docs/release-notes/<VERSION>.md` together. It also flags any file that drifted out of sync in a prior manual release, and refreshes `uv.lock`.
- **Plugins** under `tools/developer_tools/cdb_plugins/plugins/<name>/` extend both the Java portal (deployed via `make deploy-cdb-plugin` → `update_plugin_generated_files.py`) and the Python web service. `pluginTemplates/` is the scaffold.
- **REST changes touch three places**: the Java route, `openapi.yaml`, and (after `generatePyClient.sh`) the regenerated `cdbApi/` package. The Python API tests in `tools/developer_tools/python-client/test/api_test.py` are the integration check.
- **REST changes touch three places**: the Java route, `openapi.yaml`, and (after `generatePyClient.sh`) the regenerated `cdbApi/` package. The Python API tests under `tools/developer_tools/python-client/test/` are the integration check.

## Reference docs

Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ The python web service is deprecated but is still a part of the distribution for
./sbin/cdbWebService.sh
```

## Running Tests

```sh
source setup.sh
make test
```

See the test setup in `tools/developer_tools/{python-client,portal_testing/PythonSeleniumTest}/README.md`.

## Preparing a Release
`make prepare-release` bumps the version string across the repo (`etc/version`, `openapi.yaml`, web asset cache-busters, python-client `packages/*/pyproject.toml`/conda recipes) and scaffolds `docs/release-notes/<VERSION>.md`. Run it, review the diff, then commit.
```sh
Expand Down
5 changes: 4 additions & 1 deletion db/sql/test/populate_entity_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ INSERT INTO `entity_info` VALUES
(183,1,1,1,'2025-03-05 08:52:22',1,'2025-03-05 09:00:46',1,NULL,NULL),
(184,1,1,1,'2025-04-02 08:43:08',1,'2025-04-02 08:44:46',1,NULL,NULL),
(185,1,1,1,'2025-04-02 08:43:08',1,'2025-04-02 08:43:08',1,NULL,NULL),
(186,1,1,1,'2025-04-02 08:43:31',1,'2025-04-02 08:43:31',1,NULL,NULL);
(186,1,1,1,'2025-04-02 08:43:31',1,'2025-04-02 08:43:31',1,NULL,NULL),
(187,1,1,1,'2026-10-27 10:43:43',1,'2026-10-27 10:44:07',1,NULL,NULL),
(188,1,1,1,'2026-10-27 10:44:00',1,'2026-10-27 10:44:00',1,NULL,NULL),
(189,1,1,1,'2026-10-27 10:44:00',1,'2026-10-27 10:44:19',1,NULL,NULL);
/*!40000 ALTER TABLE `entity_info` ENABLE KEYS */;
UNLOCK TABLES;
4 changes: 3 additions & 1 deletion db/sql/test/populate_item.sql
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ INSERT INTO `item` VALUES
(124,2,'Item With Connectors 2',NULL,'','',NULL),
(125,9,'TEST CABLE 2',NULL,'KABEL',NULL,NULL),
(126,6,'Item with Ports 3',NULL,NULL,NULL,NULL),
(127,2,'Item With Connectors 3',NULL,'','',NULL);
(127,2,'Item With Connectors 3',NULL,'','',NULL),
(128,6,'Another Top Level ',NULL,NULL,NULL,NULL),
(129,6,'Inventory Assignment Test Destination',NULL,NULL,NULL,NULL);
/*!40000 ALTER TABLE `item` ENABLE KEYS */;
UNLOCK TABLES;
5 changes: 4 additions & 1 deletion db/sql/test/populate_item_element.sql
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ INSERT INTO `item_element` VALUES
(183,NULL,125,NULL,71,NULL,NULL,0,1,'Cable with metadata and endpoints with ports defined',NULL,183),
(184,'E3',120,126,NULL,NULL,NULL,0,1,NULL,2.00,185),
(185,NULL,126,NULL,127,NULL,NULL,0,1,'',NULL,184),
(186,NULL,127,NULL,NULL,NULL,NULL,0,1,'',NULL,186);
(186,NULL,127,NULL,NULL,NULL,NULL,0,1,'',NULL,186),
(187,NULL,128,NULL,NULL,NULL,NULL,0,1,'',NULL,187),
(188,'E1',128,129,NULL,NULL,NULL,0,1,NULL,0.00,188),
(189,NULL,129,NULL,40,NULL,NULL,0,1,'',NULL,189);
/*!40000 ALTER TABLE `item_element` ENABLE KEYS */;
UNLOCK TABLES;
6 changes: 5 additions & 1 deletion db/sql/test/populate_item_element_history.sql
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ INSERT INTO `item_element_history` VALUES
(200,'E3',184,'Machine2',120,'Item with Ports 3',126,NULL,NULL,NULL,NULL,0,1,NULL,2.00,'2025-04-02 08:43:21',1),
(201,NULL,185,'Item with Ports 3',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,'',NULL,'2025-04-02 08:43:21',1),
(202,NULL,186,'Item With Connectors 3',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,'',NULL,'2025-04-02 08:43:31',1),
(203,NULL,185,'Item with Ports 3',NULL,NULL,NULL,'Item With Connectors 3',127,NULL,NULL,0,1,'',NULL,'2025-04-02 08:44:46',1);
(203,NULL,185,'Item with Ports 3',NULL,NULL,NULL,'Item With Connectors 3',127,NULL,NULL,0,1,'',NULL,'2025-04-02 08:44:46',1),
(204,NULL,187,'Another Top Level ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,'',NULL,'2026-10-27 10:43:43',1),
(205,'E1',188,'Another Top Level ',128,'Inventory Assignment Test Destination',129,NULL,NULL,NULL,NULL,0,1,NULL,0.00,'2026-10-27 10:44:07',1),
(206,NULL,189,'Inventory Assignment Test Destination',NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,'',NULL,'2026-10-27 10:44:07',1),
(207,NULL,189,'Inventory Assignment Test Destination',NULL,NULL,NULL,'Test Item',40,NULL,NULL,0,1,'',NULL,'2026-10-27 10:44:19',1);
/*!40000 ALTER TABLE `item_element_history` ENABLE KEYS */;
UNLOCK TABLES;
4 changes: 3 additions & 1 deletion db/sql/test/populate_item_item_project.sql
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ INSERT INTO `item_item_project` VALUES
(124,3),
(125,3),
(126,3),
(127,3);
(127,3),
(128,3),
(129,3);
/*!40000 ALTER TABLE `item_item_project` ENABLE KEYS */;
UNLOCK TABLES;
6 changes: 5 additions & 1 deletion db/sql/test/populate_log.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ INSERT INTO `log` VALUES
(5,'User: cdb | Created: Template Holder [Item Id: 116]','2023-10-09 10:24:50',1,NULL,NULL,NULL),
(6,'User: cdb | Updated: Template Holder [Item Id: 116]','2023-10-09 10:25:54',1,NULL,NULL,NULL),
(7,'Authentication Succeeded: cdb','2023-10-12 13:08:58',1,NULL,NULL,NULL),
(8,'User: cdb | Created: TEST MAARC [Item Id: 119]','2023-10-12 13:09:09',1,NULL,NULL,NULL);
(8,'User: cdb | Created: TEST MAARC [Item Id: 119]','2023-10-12 13:09:09',1,NULL,NULL,NULL),
(9,'Authentication Succeeded: cdb','2026-10-27 10:43:40',1,NULL,NULL,NULL),
(10,'User: cdb | Created: Another Top Level [Item Id: 128]','2026-10-27 10:43:53',1,NULL,NULL,NULL),
(11,'User: cdb | Updated: Another Top Level [Item Id: 128]','2026-10-27 10:44:07',1,NULL,NULL,NULL),
(12,'User: cdb | Updated: Inventory Assignment Test Destination [Item Id: 129]','2026-10-27 10:44:19',1,NULL,NULL,NULL);
/*!40000 ALTER TABLE `log` ENABLE KEYS */;
UNLOCK TABLES;
6 changes: 5 additions & 1 deletion db/sql/test/populate_system_log.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ INSERT INTO `system_log` VALUES
(5,3),
(6,3),
(7,2),
(8,3);
(8,3),
(9,2),
(10,3),
(11,3),
(12,3);
/*!40000 ALTER TABLE `system_log` ENABLE KEYS */;
UNLOCK TABLES;
83 changes: 30 additions & 53 deletions sbin/cdb_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,27 @@ cd $MY_DIR/..
CDB_DIST_DIR=`pwd`
cd $CURRENT_DIR

$MY_DIR/cdb_backup_db.sh

timestamp=`date +%Y%m%d`
CDB_BACKUP_DIR=$CDB_INSTALL_DIR/backup/cdb/$timestamp
printf "\nBack up the current database and restore it after testing? [Y/n] "
read -r backup_response

backup_database=1
case "$backup_response" in
[Nn]*) backup_database=0 ;;
*)
$MY_DIR/cdb_backup_db.sh
timestamp=`date +%Y%m%d`
CDB_BACKUP_DIR=$CDB_INSTALL_DIR/backup/cdb/$timestamp
;;
esac

yes $db_password | $MY_DIR/cdb_create_db.sh cdb $CDB_DIST_DIR/db/sql/test || exit 1

printf "\nRestart Payara so it uses the newly deployed test database, then press enter to continue..."
read -r

# Regenerate the API with current code base
API_CLIENT_PATH=$CDB_DIST_DIR/tools/developer_tools/python-client/
API_CLIENT_PATH=$CDB_DIST_DIR/tools/developer_tools/python-client
export PYTHONPATH="$API_CLIENT_PATH/packages/api:$API_CLIENT_PATH/packages/cli${PYTHONPATH:+:$PYTHONPATH}"
cd $API_CLIENT_PATH
./generatePyClient.sh http://localhost:8080/cdb

Expand All @@ -42,59 +54,24 @@ cd $CDB_DIST_DIR/tools/developer_tools/code_testing/CdbWebPortalTest
mvn test

printf "$PRINTF_HEADER" "API"
cd $API_CLIENT_PATH/test
pytest api_test.py
cd $API_CLIENT_PATH
pytest test/

printf "$PRINTF_HEADER" "Selenium"
cd $CDB_DIST_DIR/tools/developer_tools/portal_testing/PythonSeleniumTest

if [ ! -d "support_bin" ]; then
mkdir support_bin
fi

cd support_bin

skiptest=0
needs_download=1

chromedriver_version_start=`google-chrome --version | grep -oP "[^A-Z ][0-9]+.[0-9]+.[0-9]+"`
chromedriver_version_regex="$chromedriver_version_start.[0-9]+/chromedriver_linux64.zip"
chromedriver_version=(`curl https://chromedriver.storage.googleapis.com/ | grep -oP $chromedriver_version_regex`)
echo ${chromedriver_version[0]}

count_results=`echo $chromedriver_version | wc -l`

if [ $count_results > 1 ]; then
chromedriver_version=`echo ${chromedriver_version%%$'\n'*}`
fi

if [ -f "chromedriver" ]; then
current_version_result=`./chromedriver --version | grep -oP $chromedriver_version`
if [[ -z "$current_version_result" ]]; then
rm chromedriver
else
needs_download=0
fi
fi

if [[ $needs_download == 1 ]]; then
wget https://chromedriver.storage.googleapis.com/$chromedriver_version || skiptest=1
unzip chromedriver_linux64.zip
rm chromedriver_linux64.zip
fi
# Selenium Manager resolves and downloads a compatible driver when Chrome starts.
pytest tests/ -n auto --dist loadfile --reruns 1 --reruns-delay 1 -rR


if [[ $skiptest == 0 ]]; then
export PATH=`pwd`:$PATH
cd ..
pytest gui_test.py
if [[ $backup_database == 1 ]]; then
printf "\n\nRestore the original database from the backup? [Y/n] "
read -r restore_response
case "$restore_response" in
[Nn]*) printf "The test database remains installed as cdb.\n" ;;
*) yes $db_password | $MY_DIR/cdb_create_db.sh cdb $CDB_BACKUP_DIR ;;
esac
else
echo "Error finding required chromedriver"
printf "\n\nBackup was skipped; the test database remains installed as cdb.\n"
fi

printf "\n\nPress enter to proceed restoring original database back to cdb..."
read -s

yes $db_password | $MY_DIR/cdb_create_db.sh cdb $CDB_BACKUP_DIR

cd $CURRENT_DIR
cd $CURRENT_DIR
Loading
Loading