Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ jobs:
scala_test_frontend_wall_clock_time:
uses: ./.github/workflows/build.scala_test.yml
with:
runs_on: self-hosted-k8s-large
runs_on: self-hosted-k8s-x-large
test_names_file: 'test-full-class-names-frontend.log'
start_canton_options: -w
parallelism: 5
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cluster_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
sha:
type: string
required: true
splice_url:
type: string
public_splice:
type: boolean
required: false

outputs:
Expand Down Expand Up @@ -42,5 +42,5 @@ jobs:
run: |
set -euo pipefail
result=$(curl -sSfL -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&splice-url=${{ inputs.splice_url }}")
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&public-splice=${{ inputs.public_splice }}")
echo "result=$result" >> "$GITHUB_OUTPUT"
13 changes: 10 additions & 3 deletions .github/workflows/notify_readme_changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ jobs:
shell: bash
run: |
# shellcheck disable=SC2028
echo "MESSAGE=*Changes to \`.md\` or \`.rst\` files have been detected and merged into the main branch.*\n<${{steps.detect_changes.outputs.GITHUB_COMMIT_URL}}| View change at ${{steps.detect_changes.outputs.GIT_LOG}}>\n\nChanged files:\n\`\`\`\n${{steps.detect_changes.outputs.CHANGED_DOC_FILES}}\n\`\`\`" >> "$GITHUB_OUTPUT"
echo "MESSAGE=*Changes to \`.md\` or \`.rst\` files have been detected and merged into the main branch.*\n<${{ steps.detect_changes.outputs.GITHUB_COMMIT_URL }}| View change at ${{ steps.detect_changes.outputs.GIT_LOG }}>\n\nChanged files:\n\`\`\`\n${{ steps.detect_changes.outputs.CHANGED_DOC_FILES }}\n\`\`\`" >> "$GITHUB_OUTPUT"

- name: Dry run
if: steps.detect_changes.outputs.FOUND_DOCUMENT_CHANGES == 'true'
shell: bash
run: |
echo "Dry run: The following message would be sent to Slack:"
echo ""
echo '${{ steps.construct_message.outputs.MESSAGE }}'

- name: Notify on document changes
if: steps.detect_changes.outputs.FOUND_DOCUMENT_CHANGES == 'true'
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
Expand All @@ -49,5 +58,3 @@ jobs:
channel: C03J6NCPSE4
text: "${{ steps.construct_message.outputs.MESSAGE }}"



10 changes: 4 additions & 6 deletions .github/workflows/pr_cluster_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@ jobs:
sha: ${{ steps.get_head.outputs.sha }}
repo: ${{ steps.get_head.outputs.repo }}
steps:
- name: Get head SHA & repo
- name: Get head SHA
id: get_head
run: |
set -euo pipefail
query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } headRepository { sshUrl } } } }'
query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } } } }'
result=$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d " { \"query\": \"$query\" } " https://api.github.com/graphql)
sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid')
repo=$(echo "$result" | jq -r '.data.repository.pullRequest.headRepository.sshUrl')
echo "sha=$sha" >> "$GITHUB_OUTPUT"
echo "repo=$repo" >> "$GITHUB_OUTPUT"

trigger_cluster_test_basic:
if: github.event.issue.pull_request && contains(github.event.comment.body, '/cluster_test')
Expand All @@ -35,7 +33,7 @@ jobs:
with:
workflow: cluster_test
sha: ${{ needs.get_head.outputs.sha }}
splice_url: ${{ needs.get_head.outputs.repo }}
public_splice: ${{ github.repository == 'hyperledger-labs/splice' }}

result:
runs-on: self-hosted-docker-tiny
Expand All @@ -56,7 +54,7 @@ jobs:
with:
workflow: hdm_test
sha: ${{ needs.get_head.outputs.sha }}
splice_url: ${{ needs.get_head.outputs.repo }}
public_splice: ${{ github.repository == 'hyperledger-labs/splice' }}

result_hdm:
runs-on: self-hosted-docker-tiny
Expand Down
4 changes: 3 additions & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ To run all Helm chart tests locally run `make cluster/helm/test`.
To run only the tests for a specific chart `CHART`, run `helm unittest cluster/helm/CHART`.

Refer to the documentation of `helm-unittest` for more information on how to extend our Helm tests.
When writing or debugging Helm tests, it is often useful to run `helm template` to see the rendered templates.
When writing or debugging Helm tests, it is often useful to run `helm unittest` with the `-d` flag.
This produces rendered yaml files under a local `.debug` folder
that can be inspected to understand errors or determine the correct paths for assertions.

### Pulumi checks

Expand Down
1 change: 1 addition & 0 deletions apps/common/frontend/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const Header: React.FC<HeaderProps> = ({ children, title, titleVariant, navLinks
<NavLink
key={index}
id={`navlink-${navLink.path}`}
data-testid={`navlink-${navLink.path}`}
to={navLink.path}
style={p => applyNavStyle(p.isActive)}
>
Expand Down
100 changes: 100 additions & 0 deletions apps/sv/frontend/src/__tests__/governance/governance-page.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
import { render, screen } from '@testing-library/react';
import { describe, expect, test } from 'vitest';
import { SvConfigProvider } from '../../utils';
import userEvent from '@testing-library/user-event';
import App from '../../App';

type UserEvent = ReturnType<typeof userEvent.setup>;

const GovernanceWithConfig = () => {
return (
<SvConfigProvider>
<App />
</SvConfigProvider>
);
};

async function login(user: UserEvent) {
render(<GovernanceWithConfig />);

expect(await screen.findByText('Log In')).toBeDefined();

const input = screen.getByRole('textbox');
await user.type(input, 'sv1');

const button = screen.getByRole('button', { name: 'Log In' });
user.click(button);
}

async function navigateToGovernancePage(user: UserEvent) {
expect(await screen.findByTestId('navlink-governance-beta')).toBeDefined();
await user.click(screen.getByText('Governance'));
}

// Skipping this test until we switch to the new UI
describe.skip('Governance Page', () => {
test('Login and navigate to Governance Page', async () => {
const user = userEvent.setup();

await login(user);
await navigateToGovernancePage(user);

const title = screen.getByTestId('governance-page-title');
expect(title).toBeDefined();
});

test('should render all Governance Page sections', async () => {
const user = userEvent.setup();

render(<GovernanceWithConfig />);

await navigateToGovernancePage(user);

const actionRequired = screen.getByTestId('action-required-section');
expect(actionRequired).toBeDefined();

const inflightVoteRequests = screen.getByTestId('inflight-vote-requests-section');
expect(inflightVoteRequests).toBeDefined();

const voteHistory = screen.getByTestId('vote-history-section');
expect(voteHistory).toBeDefined();
});

test('should display the correct number of Action Required Requests', async () => {
const user = userEvent.setup();

render(<GovernanceWithConfig />);

await navigateToGovernancePage(user);

const actions = screen.getAllByTestId('action-required-card');
expect(actions.length).toBe(4);
});

test('should show the correct number of Inflight Vote Requests', async () => {
const user = userEvent.setup();

render(<GovernanceWithConfig />);

await navigateToGovernancePage(user);

expect(() => screen.getAllByTestId('inflight-vote-requests-row')).toThrowError(
/Unable to find an element/
);
});

test('should correctly display the number of completed Vote Requests (History)', async () => {
const user = userEvent.setup();

render(<GovernanceWithConfig />);

await navigateToGovernancePage(user);

const voteRequests = screen.getAllByTestId('vote-history-row');
expect(voteRequests.length).toBe(5);

expect(true).toBe(true);
});
});
Loading
Loading