mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
ci: fix workflow
This commit is contained in:
parent
94209ada00
commit
bc6b79f783
3 changed files with 18 additions and 12 deletions
16
.github/workflows/integration-test.yml
vendored
16
.github/workflows/integration-test.yml
vendored
|
@ -26,19 +26,21 @@ jobs:
|
||||||
- name: Setup Node and pnpm
|
- name: Setup Node and pnpm
|
||||||
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
uses: silverhand-io/actions-node-pnpm-run-steps@v2
|
||||||
|
|
||||||
- name: Build
|
- name: Build and package
|
||||||
run: pnpm -r build
|
|
||||||
|
|
||||||
- name: Package
|
|
||||||
if: matrix.env != 'cloud'
|
if: matrix.env != 'cloud'
|
||||||
run: ./.scripts/package.sh
|
run: |
|
||||||
|
pnpm -r build
|
||||||
|
./.scripts/package.sh
|
||||||
|
|
||||||
- name: Package
|
- name: Build and package (Cloud)
|
||||||
if: matrix.env == 'cloud'
|
if: matrix.env == 'cloud'
|
||||||
run: ./.scripts/package.sh
|
run: |
|
||||||
|
pnpm -r build
|
||||||
|
./.scripts/package.sh
|
||||||
env:
|
env:
|
||||||
IS_CLOUD: 1
|
IS_CLOUD: 1
|
||||||
CONSOLE_PUBLIC_URL: /
|
CONSOLE_PUBLIC_URL: /
|
||||||
|
ADMIN_ENDPOINT: http://localhost:3002
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
"build": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
|
"build": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
|
||||||
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
|
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
|
||||||
"test": "pnpm build && pnpm test:api && pnpm test:ui",
|
"test": "pnpm build && pnpm test:api && pnpm test:ui",
|
||||||
"test:api": "pnpm test:only -i ./lib/tests/api",
|
"test:api": "pnpm test:only -i ./lib/tests/api/",
|
||||||
"test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui",
|
"test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui/",
|
||||||
"test:ui-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud",
|
"test:ui-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud/",
|
||||||
"lint": "eslint --ext .ts src",
|
"lint": "eslint --ext .ts src",
|
||||||
"lint:report": "pnpm lint --format json --output-file report.json",
|
"lint:report": "pnpm lint --format json --output-file report.json",
|
||||||
"start": "pnpm test"
|
"start": "pnpm test"
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
import { logtoCloudUrl, logtoConsoleUrl } from '#src/constants.js';
|
import { logtoCloudUrl, logtoConsoleUrl } from '#src/constants.js';
|
||||||
import { generatePassword } from '#src/utils.js';
|
import { generatePassword } from '#src/utils.js';
|
||||||
|
|
||||||
|
@ -8,7 +10,7 @@ import { generatePassword } from '#src/utils.js';
|
||||||
describe('smoke testing for cloud', () => {
|
describe('smoke testing for cloud', () => {
|
||||||
const consoleUsername = 'admin';
|
const consoleUsername = 'admin';
|
||||||
const consolePassword = generatePassword();
|
const consolePassword = generatePassword();
|
||||||
const adminTenantUrl = logtoConsoleUrl; // In dev mode, the console URL is actually for admin tenant
|
const adminTenantUrl = new URL(logtoConsoleUrl); // In dev mode, the console URL is actually for admin tenant
|
||||||
|
|
||||||
it('opens with app element and navigates to sign-in page', async () => {
|
it('opens with app element and navigates to sign-in page', async () => {
|
||||||
const navigation = page.waitForNavigation({ waitUntil: 'networkidle0' });
|
const navigation = page.waitForNavigation({ waitUntil: 'networkidle0' });
|
||||||
|
@ -16,6 +18,8 @@ describe('smoke testing for cloud', () => {
|
||||||
await navigation;
|
await navigation;
|
||||||
|
|
||||||
await expect(page.waitForSelector('#app')).resolves.not.toBeNull();
|
await expect(page.waitForSelector('#app')).resolves.not.toBeNull();
|
||||||
expect(page.url()).toBe(adminTenantUrl);
|
expect(page.url()).toBe(
|
||||||
|
new URL(path.join(adminTenantUrl.pathname, '/register'), adminTenantUrl).toString()
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue