Skip to content
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

ci: use setup-maas action for sitespeed #5267

Closed
wants to merge 5 commits into from
Closed
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
39 changes: 14 additions & 25 deletions .github/workflows/sitespeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,30 @@ on:
branches:
- main
- "3.*"
- ci-sitespeed-setup-maas-github-action
jobs:
run-sitespeed:
name: Run sitespeed.io
runs-on: ubuntu-22.04
env:
MAAS_DOMAIN: localhost
MAAS_DOMAIN: "127.0.0.1"
steps:
- uses: actions/checkout@main
- name: Install MAAS
run: |
sudo systemctl enable snapd
sudo snap install maas-test-db --channel=latest/edge
sudo snap install maas --channel=latest/edge
- name: Fetch database dump
uses: wei/wget@v1
- name: Setup MAAS
uses: canonical/setup-maas@main
with:
args: -O maasdb.dump https://github.com/canonical/maas-ui-testing/raw/main/db/maasdb-22.04-master-1000.dump
- name: Set up MAAS with database dump
run: |
sudo sed -i "s/dynamic_shared_memory_type = posix/dynamic_shared_memory_type = sysv/" /var/snap/maas-test-db/common/postgres/data/postgresql.conf
sudo snap restart maas-test-db
sudo mv maasdb.dump /var/snap/maas-test-db/common/maasdb.dump
sudo snap run --shell maas-test-db.psql -c 'db-dump restore /var/snap/maas-test-db/common/maasdb.dump maassampledata'
sudo maas init region+rack --maas-url=http://${{env.MAAS_DOMAIN}}:5240/MAAS --database-uri maas-test-db:///
sudo sed -i "s/database_name: maasdb/database_name: maassampledata/" /var/snap/maas/current/regiond.conf
sudo snap restart maas
maas-url: "http://${{env.MAAS_DOMAIN}}:5240/MAAS"
use-maasdb-dump: true
maasdb-dump-url: https://github.com/canonical/maas-ui-testing/raw/main/db/maasdb-22.04-master-1000.dump
- name: Create MAAS admin
run: sudo maas createadmin --username=admin --password=test [email protected]
- name: Wait for MAAS
uses: nev7n/wait_for_response@v1
with:
url: "http://${{env.MAAS_DOMAIN}}:5240/MAAS/r"
responseCode: 200
timeout: 200000
interval: 500
- name: Login to MAAS
run: |
export API_KEY=`sudo maas apikey --username=admin`
maas login admin http://localhost:5240/MAAS $API_KEY
- name: Wait for MAAS boot resources
shell: bash
run: while [ $(maas admin boot-resources is-importing | cat) == "true" ]; do sleep 10; done; echo "syncing finished"
- name: Run sitespeed.io tests
run: yarn sitespeed:ci --browsertime.domain=${{env.MAAS_DOMAIN}}
- name: Upload results
Expand Down
2 changes: 1 addition & 1 deletion sitespeed.io/scripts/machines.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const TIMEOUT = 120000;
const waitForMachines = async (context, commands, pageSize = 50) => {
context.log.info("waiting for machine list count");
await commands.wait.byCondition(
`document.querySelector('[data-testid="section-header-title"]').textContent.includes("1000 machines")`,
`document.querySelector('[data-testid="main-toolbar-heading"]').textContent.includes("1000 machines")`,
TIMEOUT
);
context.log.info(`waiting for ${pageSize} machine list rows`);
Expand Down
Loading