Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
84 changes: 77 additions & 7 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
# docker ps

- name: Checkout ab-cli
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -47,7 +47,11 @@ jobs:
run: docker swarm init --advertise-addr 127.0.0.1

- name: Install AppBuilder
run: node index.js install ab-test --stack=ab-test --develop --port=80 --tag=latest --dbExpose=true --dbPort=8888 --dbPassword=root --authType=login --relayEnabled=false --siteURL=http://localhost:80 --tenant.username=admin --tenant.password=admin --tenant.email=admin@email.com --tenant.url=http://localhost:80
env:
TENANT_PASSWORD: "admin"
run: |
echo "Installing AppBuilder with secure password..."
node index.js install ab-test --stack=ab-test --port=8090 --tag=latest --dbExpose=true --dbPort=8888 --dbPassword=root --authType=login --relayEnabled=false --siteURL=http://localhost:8090 --tenant.username=admin --tenant.password=$TENANT_PASSWORD --tenant.email=admin@email.com --tenant.url=http://localhost:8090 --platform=podman

# Give some time for the stack to come down fully
- run: sleep 15
Expand All @@ -59,9 +63,34 @@ jobs:
- name: Wait for AB (Main Stack)
uses: ifaxity/wait-on-action@v1
with:
resource: http://localhost:80
resource: http://localhost:8090
timeout: 300000

- name: Test Login 1
run: |
curl -X POST http://localhost:8090/auth/login \
-H "Content-Type: application/json" \
-d '{"tenant":"admin","email":"admin@email.com","password":"admin"}'
working-directory: ./ab-test

- name: Reset Test Environment
run: npm run test:reset ab-test
working-directory: ./ab-test

- name: Reset via API
run: |
curl -X POST http://localhost:8090/test/reset \
-H "Content-Type: application/json" \
-d '{"tenant":"admin"}'
working-directory: ./ab-test

- name: Test Login post reset
run: |
curl -X POST http://localhost:8090/auth/login \
-H "Content-Type: application/json" \
-d '{"tenant":"admin","email":"admin@email.com","password":"admin"}'
working-directory: ./ab-test

- name: Run Cypress Tests (Main Stack)
run: npm run test:e2e:ab-runtime -- --browser chrome
working-directory: ./ab-test
Expand All @@ -86,7 +115,7 @@ jobs:
# - name: Wait for AB (Test Stack)
# uses: ifaxity/wait-on-action@v1
# with:
# resource: http://localhost:8088
# resource: http://localhost:809088
# timeout: 300000
#
# - name: Run Cypress Tests (Test Stack)
Expand Down Expand Up @@ -116,34 +145,75 @@ jobs:
CYPRESS_RETRIES: 2
steps:
- run: sudo apt-get update & sudo apt-get -y install podman & systemctl --user enable --now podman.socket
# connect Docker CLI to Podmans socket
# connect Docker CLI to Podman's socket
- run: export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock


- run: podman version
- run: podman compose --help

- name: Checkout ab-cli
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Install npm packages
run: npm i

- name: Ensure clean enviroment
run: rm -rf ./ab-test

- name: Install AppBuilder
run: node index.js install ab-test --stack=ab-test --port=8090 --tag=latest --dbExpose=true --dbPort=8888 --dbPassword=root --authType=login --relayEnabled=false --siteURL=http://localhost:8090 --tenant.username=admin --tenant.password=admin --tenant.email=admin@email.com --tenant.url=http://localhost:8090 --platform=podman
env:
TENANT_PASSWORD: "admin"
run: |
echo "Installing AppBuilder with secure password..."
node index.js install ab-test --stack=ab-test --port=8090 --tag=latest --dbExpose=true --dbPort=8888 --dbPassword=root --authType=login --relayEnabled=false --siteURL=http://localhost:8090 --tenant.username=admin --tenant.password=$TENANT_PASSWORD --tenant.email=admin@email.com --tenant.url=http://localhost:8090 --platform=podman

# Give some time for the stack to come down fully
- run: sleep 15
- name: Launch Main Stack
run: ./UP.sh -t -q
working-directory: ./ab-test

- name: Check Database Logs
run: |
echo "Checking database logs..."
podman logs $(podman ps -q -f name=ab-test_db) | tail -n 50
working-directory: ./ab-test

- name: Check Tenant Setup
run: |
echo "Listing all running containers..."
podman ps -a
echo "\nWaiting for database to be ready..."
sleep 90
echo "\nTrying to find database container..."
DB_CONTAINER=$(podman ps -a --filter name=db --format "{{.Names}}")
echo "Found containers matching 'db': $DB_CONTAINER"
if [ -n "$DB_CONTAINER" ]; then
echo "\nChecking tenant setup in container: $DB_CONTAINER"
podman exec -i $DB_CONTAINER mysql -uroot -proot "appbuilder-admin" -e "SELECT username, email, salt FROM SITE_USER WHERE username='admin';"
echo "\nChecking .env file for Cypress settings..."
cat .env | grep CYPRESS
else
echo "No database container found!"
fi
working-directory: ./ab-test


- name: Wait for AB (Main Stack)
uses: ifaxity/wait-on-action@v1
with:
resource: http://localhost:8090
timeout: 300000

- name: Test Login
run: |
echo "Testing login with credentials..."
curl -X POST http://localhost:8090/auth/login \
-H "Content-Type: application/json" \
-d '{"tenant":"admin","email":"admin@email.com","password":"admin"}'
working-directory: ./ab-test

- name: Run Cypress Tests (Main Stack)
run: npm run test:e2e:ab-runtime -- --browser chrome
working-directory: ./ab-test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ lib-cov
*.log
*.out
*.pid
.vscode


node_modules/
Expand Down
Loading