0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

ci: fix workflow

This commit is contained in:
Gao Sun 2023-03-06 13:45:14 +08:00
parent 94209ada00
commit bc6b79f783
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
3 changed files with 18 additions and 12 deletions

View file

@ -26,19 +26,21 @@ jobs:
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v2
- name: Build
run: pnpm -r build
- name: Package
- name: Build and package
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'
run: ./.scripts/package.sh
run: |
pnpm -r build
./.scripts/package.sh
env:
IS_CLOUD: 1
CONSOLE_PUBLIC_URL: /
ADMIN_ENDPOINT: http://localhost:3002
- uses: actions/upload-artifact@v3
with:

View file

@ -13,9 +13,9 @@
"build": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap",
"test:only": "NODE_OPTIONS=--experimental-vm-modules jest",
"test": "pnpm build && pnpm test:api && pnpm test:ui",
"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-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud",
"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-cloud": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui-cloud/",
"lint": "eslint --ext .ts src",
"lint:report": "pnpm lint --format json --output-file report.json",
"start": "pnpm test"

View file

@ -1,3 +1,5 @@
import path from 'path';
import { logtoCloudUrl, logtoConsoleUrl } from '#src/constants.js';
import { generatePassword } from '#src/utils.js';
@ -8,7 +10,7 @@ import { generatePassword } from '#src/utils.js';
describe('smoke testing for cloud', () => {
const consoleUsername = 'admin';
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 () => {
const navigation = page.waitForNavigation({ waitUntil: 'networkidle0' });
@ -16,6 +18,8 @@ describe('smoke testing for cloud', () => {
await navigation;
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()
);
});
});