Skip to content

Commit

Permalink
feat: added quality gate check to pipeline (#1580)
Browse files Browse the repository at this point in the history
- added quality gate check to pipeline
  • Loading branch information
leszek-vechain authored Dec 13, 2024
1 parent 1e0e536 commit a046af8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Sonar Scan
on:
workflow_run:
workflows: [PR Checks, Main CI]
workflows: [ PR Checks, Main CI ]
types:
- completed

Expand All @@ -24,11 +24,24 @@ jobs:
path: coverage

- name: SonarCloud Scan
id: sonarcloud-scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.verbose=false
-Dsonar.branch.name=${{ github.head_ref || github.ref_name }}
-Dsonar.branch.name=${{ github.head_ref || github.ref_name }}
- name: SonarCloud Quality Gate Check
id: sonarqube-quality-gate-check
if: ${{ always() && steps.sonarcloud-scan.outputs.status == 'success' }}
uses: sonarsource/sonarqube-quality-gate-action@master
with:
pollingTimeoutSec: 600
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Quality Gate Status
run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}"
2 changes: 1 addition & 1 deletion apps/sdk-nextjs-integration/e2e/hash.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('Hash example', async ({ page }) => {
await hashLink.click();

// Enter content to hash
const content = "SDK is awesome!";
const content = "SDK is awesome! :)";
const hashInput = page.getByTestId('contentToHash');
await hashInput.clear();
await hashInput.fill(content);
Expand Down
21 changes: 14 additions & 7 deletions packages/network/tests/thor-client/contracts/contract.solo.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/* eslint-disable */

import { beforeEach, describe, expect, test } from '@jest/globals';
import { ABIContract, Address, type DeployParams, HexUInt } from '@vechain/sdk-core';
import {
ABIContract,
Address,
type DeployParams,
HexUInt
} from '@vechain/sdk-core';
import {
CannotFindTransaction,
ContractDeploymentFailed,
Expand Down Expand Up @@ -203,7 +208,9 @@ describe('ThorClient - Contracts', () => {

// Retrieve the bytecode of the deployed contract
const contractBytecodeResponse =
await thorSoloClient.accounts.getBytecode(Address.of(contract.address));
await thorSoloClient.accounts.getBytecode(
Address.of(contract.address)
);

// Assertion: Compare with the expected deployed contract bytecode
expect(`${contractBytecodeResponse}`).toBe(deployedContractBytecode);
Expand Down Expand Up @@ -486,9 +493,9 @@ describe('ThorClient - Contracts', () => {
if (error instanceof Error) {
expect(error.message).toEqual(
`Method 'getSecretData()' failed.` +
`\n-Reason: 'Not the contract owner'` +
`\n-Parameters: \n\t` +
`{\n "contractAddress": "${deployedContract.address}"\n}`
`\n-Reason: 'Not the contract owner'` +
`\n-Parameters: \n\t` +
`{\n "contractAddress": "${deployedContract.address}"\n}`
);
}
}
Expand Down Expand Up @@ -796,11 +803,11 @@ describe('ThorClient - Contracts', () => {
test('Should return the base gas price of the Solo network', async () => {
const baseGasPrice =
await thorSoloClient.contracts.getBaseGasPrice();
expect(baseGasPrice).toEqual( {
expect(baseGasPrice).toEqual({
success: true,
result: { plain: 1000000000000000n, array: [1000000000000000n] }
});
expect(baseGasPrice).toEqual( {
expect(baseGasPrice).toEqual({
success: true,
result: { plain: BigInt(10 ** 15), array: [BigInt(10 ** 15)] }
}); // 10^13 wei
Expand Down

1 comment on commit a046af8

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 99%
99% (4369/4413) 97.55% (1398/1433) 99.01% (906/915)
Title Tests Skipped Failures Errors Time
core 836 0 πŸ’€ 0 ❌ 0 πŸ”₯ 2m 27s ⏱️
network 729 0 πŸ’€ 0 ❌ 0 πŸ”₯ 5m 2s ⏱️
errors 42 0 πŸ’€ 0 ❌ 0 πŸ”₯ 18.085s ⏱️
logging 3 0 πŸ’€ 0 ❌ 0 πŸ”₯ 18.702s ⏱️
hardhat-plugin 19 0 πŸ’€ 0 ❌ 0 πŸ”₯ 1m 3s ⏱️
aws-kms-adapter 23 0 πŸ’€ 0 ❌ 0 πŸ”₯ 1m 21s ⏱️
ethers-adapter 5 0 πŸ’€ 0 ❌ 0 πŸ”₯ 1m 17s ⏱️
rpc-proxy 37 0 πŸ’€ 0 ❌ 0 πŸ”₯ 1m 6s ⏱️

Please sign in to comment.