Skip to content

Commit 3ac6e5a

Browse files
author
DA Automation
committed
[ci] Update Splice from CCI
Signed-off-by: DA Automation <splice-maintainers@digitalasset.com>
1 parent 8c6506c commit 3ac6e5a

File tree

75 files changed

+1483
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1483
-141
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
scala_test_frontend_wall_clock_time:
140140
uses: ./.github/workflows/build.scala_test.yml
141141
with:
142-
runs_on: self-hosted-k8s-large
142+
runs_on: self-hosted-k8s-x-large
143143
test_names_file: 'test-full-class-names-frontend.log'
144144
start_canton_options: -w
145145
parallelism: 5

.github/workflows/cluster_tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
sha:
1010
type: string
1111
required: true
12-
splice_url:
13-
type: string
12+
public_splice:
13+
type: boolean
1414
required: false
1515

1616
outputs:
@@ -42,5 +42,5 @@ jobs:
4242
run: |
4343
set -euo pipefail
4444
result=$(curl -sSfL -H "Authorization: Bearer ${{ steps.auth.outputs.id_token }}" \
45-
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&splice-url=${{ inputs.splice_url }}")
45+
"${{ secrets.CLUSTER_TEST_INVOKER_URL }}?workflow=${{ inputs.workflow }}&splice-git-ref=${{ inputs.sha }}&public-splice=${{ inputs.public_splice }}")
4646
echo "result=$result" >> "$GITHUB_OUTPUT"

.github/workflows/notify_readme_changes.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ jobs:
3838
shell: bash
3939
run: |
4040
# shellcheck disable=SC2028
41-
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"
41+
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"
42+
43+
- name: Dry run
44+
if: steps.detect_changes.outputs.FOUND_DOCUMENT_CHANGES == 'true'
45+
shell: bash
46+
run: |
47+
echo "Dry run: The following message would be sent to Slack:"
48+
echo ""
49+
echo '${{ steps.construct_message.outputs.MESSAGE }}'
50+
4251
- name: Notify on document changes
4352
if: steps.detect_changes.outputs.FOUND_DOCUMENT_CHANGES == 'true'
4453
uses: slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
@@ -49,5 +58,3 @@ jobs:
4958
channel: C03J6NCPSE4
5059
text: "${{ steps.construct_message.outputs.MESSAGE }}"
5160
52-
53-

.github/workflows/pr_cluster_test.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,14 @@ jobs:
1616
sha: ${{ steps.get_head.outputs.sha }}
1717
repo: ${{ steps.get_head.outputs.repo }}
1818
steps:
19-
- name: Get head SHA & repo
19+
- name: Get head SHA
2020
id: get_head
2121
run: |
2222
set -euo pipefail
23-
query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } headRepository { sshUrl } } } }'
23+
query='query pullRequestDetails { repository(name: \"${{ github.event.repository.name }}\", owner: \"${{ github.repository_owner }}\") { pullRequest(number: ${{ github.event.issue.number }}) { headRef { target { oid } } } } }'
2424
result=$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -X POST -d " { \"query\": \"$query\" } " https://api.github.com/graphql)
2525
sha=$(echo "$result" | jq -r '.data.repository.pullRequest.headRef.target.oid')
26-
repo=$(echo "$result" | jq -r '.data.repository.pullRequest.headRepository.sshUrl')
2726
echo "sha=$sha" >> "$GITHUB_OUTPUT"
28-
echo "repo=$repo" >> "$GITHUB_OUTPUT"
2927
3028
trigger_cluster_test_basic:
3129
if: github.event.issue.pull_request && contains(github.event.comment.body, '/cluster_test')
@@ -35,7 +33,7 @@ jobs:
3533
with:
3634
workflow: cluster_test
3735
sha: ${{ needs.get_head.outputs.sha }}
38-
splice_url: ${{ needs.get_head.outputs.repo }}
36+
public_splice: ${{ github.repository == 'hyperledger-labs/splice' }}
3937

4038
result:
4139
runs-on: self-hosted-docker-tiny
@@ -56,7 +54,7 @@ jobs:
5654
with:
5755
workflow: hdm_test
5856
sha: ${{ needs.get_head.outputs.sha }}
59-
splice_url: ${{ needs.get_head.outputs.repo }}
57+
public_splice: ${{ github.repository == 'hyperledger-labs/splice' }}
6058

6159
result_hdm:
6260
runs-on: self-hosted-docker-tiny

TESTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,9 @@ To run all Helm chart tests locally run `make cluster/helm/test`.
382382
To run only the tests for a specific chart `CHART`, run `helm unittest cluster/helm/CHART`.
383383

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

387389
### Pulumi checks
388390

apps/common/frontend/src/components/Header.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const Header: React.FC<HeaderProps> = ({ children, title, titleVariant, navLinks
6060
<NavLink
6161
key={index}
6262
id={`navlink-${navLink.path}`}
63+
data-testid={`navlink-${navLink.path}`}
6364
to={navLink.path}
6465
style={p => applyNavStyle(p.isActive)}
6566
>
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import { render, screen } from '@testing-library/react';
4+
import { describe, expect, test } from 'vitest';
5+
import { SvConfigProvider } from '../../utils';
6+
import userEvent from '@testing-library/user-event';
7+
import App from '../../App';
8+
9+
type UserEvent = ReturnType<typeof userEvent.setup>;
10+
11+
const GovernanceWithConfig = () => {
12+
return (
13+
<SvConfigProvider>
14+
<App />
15+
</SvConfigProvider>
16+
);
17+
};
18+
19+
async function login(user: UserEvent) {
20+
render(<GovernanceWithConfig />);
21+
22+
expect(await screen.findByText('Log In')).toBeDefined();
23+
24+
const input = screen.getByRole('textbox');
25+
await user.type(input, 'sv1');
26+
27+
const button = screen.getByRole('button', { name: 'Log In' });
28+
user.click(button);
29+
}
30+
31+
async function navigateToGovernancePage(user: UserEvent) {
32+
expect(await screen.findByTestId('navlink-governance-beta')).toBeDefined();
33+
await user.click(screen.getByText('Governance'));
34+
}
35+
36+
// Skipping this test until we switch to the new UI
37+
describe.skip('Governance Page', () => {
38+
test('Login and navigate to Governance Page', async () => {
39+
const user = userEvent.setup();
40+
41+
await login(user);
42+
await navigateToGovernancePage(user);
43+
44+
const title = screen.getByTestId('governance-page-title');
45+
expect(title).toBeDefined();
46+
});
47+
48+
test('should render all Governance Page sections', async () => {
49+
const user = userEvent.setup();
50+
51+
render(<GovernanceWithConfig />);
52+
53+
await navigateToGovernancePage(user);
54+
55+
const actionRequired = screen.getByTestId('action-required-section');
56+
expect(actionRequired).toBeDefined();
57+
58+
const inflightVoteRequests = screen.getByTestId('inflight-vote-requests-section');
59+
expect(inflightVoteRequests).toBeDefined();
60+
61+
const voteHistory = screen.getByTestId('vote-history-section');
62+
expect(voteHistory).toBeDefined();
63+
});
64+
65+
test('should display the correct number of Action Required Requests', async () => {
66+
const user = userEvent.setup();
67+
68+
render(<GovernanceWithConfig />);
69+
70+
await navigateToGovernancePage(user);
71+
72+
const actions = screen.getAllByTestId('action-required-card');
73+
expect(actions.length).toBe(4);
74+
});
75+
76+
test('should show the correct number of Inflight Vote Requests', async () => {
77+
const user = userEvent.setup();
78+
79+
render(<GovernanceWithConfig />);
80+
81+
await navigateToGovernancePage(user);
82+
83+
expect(() => screen.getAllByTestId('inflight-vote-requests-row')).toThrowError(
84+
/Unable to find an element/
85+
);
86+
});
87+
88+
test('should correctly display the number of completed Vote Requests (History)', async () => {
89+
const user = userEvent.setup();
90+
91+
render(<GovernanceWithConfig />);
92+
93+
await navigateToGovernancePage(user);
94+
95+
const voteRequests = screen.getAllByTestId('vote-history-row');
96+
expect(voteRequests.length).toBe(5);
97+
98+
expect(true).toBe(true);
99+
});
100+
});

0 commit comments

Comments
 (0)