-
Notifications
You must be signed in to change notification settings - Fork 16
Bump dependencies for OCP 4.23/5.0 and add test infrastructure #118
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,9 @@ jobs: | |
| - name: Lint | ||
| run: make lint | ||
|
|
||
| - name: Test | ||
| run: make test | ||
|
|
||
| - name: clean | ||
| run: make clean | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # SDK 4.23 prerelease declares react-router ~7.13.1 as peerOptional, | ||
| # but console release-4.23 ships ~7.18.1. Remove when SDK catches up. | ||
| legacy-peer-deps=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| import { describe, it, expect } from "vitest"; | ||
|
|
||
| describe("PatternFly react-core imports", () => { | ||
| it("resolves layout components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.PageSection).toBeDefined(); | ||
| expect(mod.Stack).toBeDefined(); | ||
| expect(mod.StackItem).toBeDefined(); | ||
| expect(mod.Grid).toBeDefined(); | ||
| expect(mod.GridItem).toBeDefined(); | ||
| expect(mod.Flex).toBeDefined(); | ||
| expect(mod.FlexItem).toBeDefined(); | ||
| expect(mod.Bullseye).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves form components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.Form).toBeDefined(); | ||
| expect(mod.FormGroup).toBeDefined(); | ||
| expect(mod.FormSection).toBeDefined(); | ||
| expect(mod.TextInput).toBeDefined(); | ||
| expect(mod.TextInputTypes).toBeDefined(); | ||
| expect(mod.Radio).toBeDefined(); | ||
| expect(mod.NumberInput).toBeDefined(); | ||
| expect(mod.Checkbox).toBeDefined(); | ||
| expect(mod.FormHelperText).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves modal components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.Modal).toBeDefined(); | ||
| expect(mod.ModalVariant).toBeDefined(); | ||
| expect(mod.ModalHeader).toBeDefined(); | ||
| expect(mod.ModalBody).toBeDefined(); | ||
| expect(mod.ModalFooter).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves feedback components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.Alert).toBeDefined(); | ||
| expect(mod.AlertVariant).toBeDefined(); | ||
| expect(mod.Popover).toBeDefined(); | ||
| expect(mod.Tooltip).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves select components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.Select).toBeDefined(); | ||
| expect(mod.SelectOption).toBeDefined(); | ||
| expect(mod.MenuToggle).toBeDefined(); | ||
| expect(mod.SelectList).toBeDefined(); | ||
| expect(mod.Divider).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves misc components", async () => { | ||
| const mod = await import("@patternfly/react-core"); | ||
| expect(mod.Button).toBeDefined(); | ||
| expect(mod.ButtonVariant).toBeDefined(); | ||
| expect(mod.Label).toBeDefined(); | ||
| expect(mod.Title).toBeDefined(); | ||
| expect(mod.Content).toBeDefined(); | ||
| expect(mod.DescriptionList).toBeDefined(); | ||
| expect(mod.EmptyState).toBeDefined(); | ||
| expect(mod.ExpandableSection).toBeDefined(); | ||
| expect(mod.Icon).toBeDefined(); | ||
| expect(mod.List).toBeDefined(); | ||
| expect(mod.ListItem).toBeDefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("PatternFly react-icons imports", () => { | ||
| it("resolves status icons", async () => { | ||
| const mod = await import("@patternfly/react-icons"); | ||
| expect(mod.CheckCircleIcon).toBeDefined(); | ||
| expect(mod.ExclamationCircleIcon).toBeDefined(); | ||
| expect(mod.ExclamationTriangleIcon).toBeDefined(); | ||
| expect(mod.InfoCircleIcon).toBeDefined(); | ||
| expect(mod.HourglassHalfIcon).toBeDefined(); | ||
| expect(mod.InProgressIcon).toBeDefined(); | ||
| }); | ||
|
|
||
| it("resolves action icons", async () => { | ||
| const mod = await import("@patternfly/react-icons"); | ||
| expect(mod.PlusCircleIcon).toBeDefined(); | ||
| expect(mod.MinusCircleIcon).toBeDefined(); | ||
| expect(mod.PencilAltIcon).toBeDefined(); | ||
| expect(mod.EllipsisVIcon).toBeDefined(); | ||
| expect(mod.DownloadIcon).toBeDefined(); | ||
| expect(mod.ExternalLinkAltIcon).toBeDefined(); | ||
| expect(mod.SearchIcon).toBeDefined(); | ||
| expect(mod.OutlinedQuestionCircleIcon).toBeDefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("PatternFly react-table imports", () => { | ||
| it("resolves table components and utilities", async () => { | ||
| const mod = await import("@patternfly/react-table"); | ||
| expect(mod.Table).toBeDefined(); | ||
| expect(mod.Thead).toBeDefined(); | ||
| expect(mod.Tbody).toBeDefined(); | ||
| expect(mod.Tr).toBeDefined(); | ||
| expect(mod.Th).toBeDefined(); | ||
| expect(mod.Td).toBeDefined(); | ||
| expect(mod.sortable).toBeDefined(); | ||
| expect(mod.SortByDirection).toBeDefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("PatternFly react-tokens imports", () => { | ||
| it("resolves design tokens used in the project", async () => { | ||
| const mod = await import("@patternfly/react-tokens"); | ||
| expect(mod.t_global_icon_color_status_info_default).toBeDefined(); | ||
| expect(mod.t_global_text_color_link_default).toBeDefined(); | ||
| expect(mod.t_global_color_status_danger_100).toBeDefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("react-router imports", () => { | ||
| it("resolves navigation hooks and components", async () => { | ||
| const mod = await import("react-router"); | ||
| expect(mod.useNavigate).toBeDefined(); | ||
| expect(mod.useLocation).toBeDefined(); | ||
| expect(mod.Link).toBeDefined(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,134 @@ | ||
| import { describe, it, expect } from "vitest"; | ||
| import { | ||
| getStringKind, | ||
| getApiVersion, | ||
| parseApiVersion, | ||
| apiVersionToGroupVersionKind, | ||
| getCreateInstanceUrl, | ||
| nodeHealthCheckKind, | ||
| nodeHealthCheckStringKind, | ||
| NodeHealthCheckModel, | ||
| getNodeHealthCheckApiVersion, | ||
| nodeKind, | ||
| } from "../model"; | ||
|
|
||
| describe("getStringKind", () => { | ||
| it("joins group, version, and kind with tildes", () => { | ||
| expect( | ||
| getStringKind({ group: "apps", version: "v1", kind: "Deployment" }) | ||
| ).toBe("apps~v1~Deployment"); | ||
| }); | ||
|
|
||
| it("handles empty group", () => { | ||
| expect(getStringKind({ group: "", version: "v1", kind: "Pod" })).toBe( | ||
| "~v1~Pod" | ||
| ); | ||
| }); | ||
| }); | ||
|
|
||
| describe("getApiVersion", () => { | ||
| it("joins group and version with slash", () => { | ||
| expect( | ||
| getApiVersion({ group: "apps", version: "v1", kind: "Deployment" }) | ||
| ).toBe("apps/v1"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("parseApiVersion", () => { | ||
| it("parses valid apiVersion", () => { | ||
| expect(parseApiVersion("apps/v1")).toEqual({ | ||
| group: "apps", | ||
| version: "v1", | ||
| }); | ||
| }); | ||
|
|
||
| it("returns undefined for empty string", () => { | ||
| expect(parseApiVersion("")).toBeUndefined(); | ||
| }); | ||
|
|
||
| it("parses a core-group apiVersion", () => { | ||
| expect(parseApiVersion("v1")).toEqual({ group: "", version: "v1" }); | ||
| }); | ||
|
|
||
| it("returns undefined for string with multiple slashes", () => { | ||
| expect(parseApiVersion("a/b/c")).toBeUndefined(); | ||
| }); | ||
|
|
||
| it("returns undefined for slash-only parts", () => { | ||
| expect(parseApiVersion("/v1")).toBeUndefined(); | ||
| expect(parseApiVersion("apps/")).toBeUndefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("apiVersionToGroupVersionKind", () => { | ||
| it("converts valid apiVersion and kind", () => { | ||
| expect(apiVersionToGroupVersionKind("apps/v1", "Deployment")).toEqual({ | ||
| group: "apps", | ||
| version: "v1", | ||
| kind: "Deployment", | ||
| }); | ||
| }); | ||
|
|
||
| it("returns undefined for empty apiVersion", () => { | ||
| expect(apiVersionToGroupVersionKind("", "Pod")).toBeUndefined(); | ||
| }); | ||
|
|
||
| it("returns undefined for empty kind", () => { | ||
| expect(apiVersionToGroupVersionKind("apps/v1", "")).toBeUndefined(); | ||
| }); | ||
|
|
||
| it("converts core-group apiVersion", () => { | ||
| expect(apiVersionToGroupVersionKind("v1", "Pod")).toEqual({ | ||
| group: "", | ||
| version: "v1", | ||
| kind: "Pod", | ||
| }); | ||
| }); | ||
| }); | ||
|
|
||
| describe("getCreateInstanceUrl", () => { | ||
| it("builds correct URL", () => { | ||
| expect(getCreateInstanceUrl("apps/v1", "Deployment")).toBe( | ||
| "/k8s/cluster/apps~v1~Deployment/~new" | ||
| ); | ||
| }); | ||
|
|
||
| it("returns undefined for empty inputs", () => { | ||
| expect(getCreateInstanceUrl("", "Pod")).toBeUndefined(); | ||
| expect(getCreateInstanceUrl("apps/v1", "")).toBeUndefined(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("NHC constants", () => { | ||
| it("nodeHealthCheckKind has correct values", () => { | ||
| expect(nodeHealthCheckKind).toEqual({ | ||
| kind: "NodeHealthCheck", | ||
| group: "remediation.medik8s.io", | ||
| version: "v1alpha1", | ||
| }); | ||
| }); | ||
|
|
||
| it("nodeHealthCheckStringKind is derived correctly", () => { | ||
| expect(nodeHealthCheckStringKind).toBe( | ||
| "remediation.medik8s.io~v1alpha1~NodeHealthCheck" | ||
| ); | ||
| }); | ||
|
|
||
| it("nodeKind has correct values", () => { | ||
| expect(nodeKind).toEqual({ kind: "Node", version: "v1" }); | ||
| }); | ||
|
|
||
| it("NodeHealthCheckModel is consistent with nodeHealthCheckKind", () => { | ||
| expect(NodeHealthCheckModel.kind).toBe(nodeHealthCheckKind.kind); | ||
| expect(NodeHealthCheckModel.apiGroup).toBe(nodeHealthCheckKind.group); | ||
| expect(NodeHealthCheckModel.apiVersion).toBe(nodeHealthCheckKind.version); | ||
| expect(NodeHealthCheckModel.namespaced).toBe(false); | ||
| expect(NodeHealthCheckModel.plural).toBe("nodehealthchecks"); | ||
| }); | ||
|
|
||
| it("getNodeHealthCheckApiVersion returns correct string", () => { | ||
| expect(getNodeHealthCheckApiVersion()).toBe( | ||
| "remediation.medik8s.io/v1alpha1" | ||
| ); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.