Skip to content

Commit

Permalink
Merge branch 'main' into form-view-only
Browse files Browse the repository at this point in the history
  • Loading branch information
cdrage authored Mar 28, 2024
2 parents 547d229 + 43fb84b commit 806cd40
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
run: yarn format:check

- name: Run tests
run: yarn test:unit
run: yarn test

- name: Run typecheck
run: yarn typecheck
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,27 @@ git clone https://github.com/containers/podman-desktop-extension-bootc
cd podman-desktop
yarn watch --extension-folder ../podman-desktop-extension-bootc/packages/backend
```

### Testing & Developing

Workflow for developing would be the following:

```sh
# Bootc root folder:
yarn watch

# In a separate terminal in the Podman Desktop folder:
yarn watch --extension-folder ../podman-desktop-extension-bootc/packages/backend
```

Workflow for testing and validation checking before PR submission:

```sh
# Tests
yarn test

# Formatting, linting and typecheck
yarn format:fix
yarn lint:fix
yarn typecheck
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"test:backend": "vitest run -r packages/backend --passWithNoTests --coverage",
"test:frontend": "vitest run -r packages/frontend --passWithNoTests --coverage",
"test:shared": "vitest run -r packages/shared --passWithNoTests --coverage",
"test:unit": "npm run test:backend && npm run test:shared && npm run test:frontend",
"test": "npm run test:backend && npm run test:shared && npm run test:frontend",
"test:e2e": "cd tests/playwright && npm run test:e2e",
"typecheck:shared": "tsc --noEmit --project packages/shared",
"typecheck:frontend": "tsc --noEmit --project packages/frontend",
Expand Down
19 changes: 16 additions & 3 deletions packages/backend/src/build-disk-image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ beforeEach(() => {

test('check image builder options', async () => {
const image = 'test-image';
const type = 'iso';
const type = 'raw';
const arch = 'amd';
const name = 'my-image';
const outputFolder = '/output-folder';
Expand All @@ -59,7 +59,7 @@ test('check image builder options', async () => {

test('check image builder with multiple types', async () => {
const image = 'test-image';
const type: BuildType[] = ['iso', 'vmdk'];
const type: BuildType[] = ['raw', 'vmdk'];
const arch = 'amd';
const name = 'my-image';
const outputFolder = '/output-folder';
Expand Down Expand Up @@ -89,7 +89,7 @@ test('check image builder with multiple types', async () => {

test('check image builder does not include target arch', async () => {
const image = 'test-image';
const type = 'iso';
const type = 'vmdk';
const name = 'my-image';
const outputFolder = '/output-folder';
const options = createBuilderImageOptions(name, image, [type], undefined, outputFolder);
Expand All @@ -98,6 +98,19 @@ test('check image builder does not include target arch', async () => {
expect(options.Cmd).not.toContain('--target-arch');
});

// temporary test, see createBuilderImageOptions
test('temporarily check image builder does not include target arch for iso', async () => {
const image = 'test-image';
const type = 'iso';
const arch = 'amd';
const name = 'my-image';
const outputFolder = '/output-folder';
const options = createBuilderImageOptions(name, image, [type], arch, outputFolder);

expect(options).toBeDefined();
expect(options.Cmd).not.toContain('--target-arch');
});

test('check we pick unused container name', async () => {
const basename = 'test';
let name = await getUnusedName(basename);
Expand Down
8 changes: 7 additions & 1 deletion packages/backend/src/build-disk-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,13 @@ export function createBuilderImageOptions(
const cmd = [image, '--output', '/output/', '--local'];

type.forEach(t => cmd.push('--type', t));
if (arch) {

// bootc image builder does not currently support specifying a target arch
// (even the current/default one) when building an iso. Enough people are
// hitting this that we are putting in a temporary workaround until the
// following issue is resolved:
// https://github.com/osbuild/bootc-image-builder/issues/316
if (arch && !type.find(buildType => buildType === 'iso')) {
cmd.push('--target-arch', arch);
}

Expand Down

0 comments on commit 806cd40

Please sign in to comment.