Skip to content
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

Fix E2E confirmation flakiness and object not extensible #7802

Merged
merged 9 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ class TransactionReviewInformation extends PureComponent {
/**
* Transaction error
*/
error: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
error: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.node,
]),
/**
* True if transaction is over the available funds
*/
Expand Down
6 changes: 5 additions & 1 deletion app/components/UI/TransactionReview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ class TransactionReview extends PureComponent {
/**
* Error blockaid transaction execution, undefined value signifies no error.
*/
error: PropTypes.oneOf[(PropTypes.bool, PropTypes.string)],
error: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.string,
PropTypes.node,
]),
/**
* Whether or not basic gas estimates have been fetched
*/
Expand Down
2 changes: 1 addition & 1 deletion bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ workflows:
asdf global nodejs 18.18
asdf plugin add yarn
asdf list all yarn
asdf install yarn latest
asdf install yarn 1.22.19
Copy link
Contributor Author

@vinistevam vinistevam Nov 14, 2023

Choose a reason for hiding this comment

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

This is just to fix the pipeline until yarn fixes the artifacts in their repo. Once it's fixed we can revert back to latest

asdf global yarn 1.22.19
title: Install node and yarn
- yarn@0:
Expand Down
20 changes: 16 additions & 4 deletions e2e/fixtures/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,33 @@ import { DEFAULT_GANACHE_PORT } from '../../app/util/test/ganache';
import { DEFAULT_FIXTURE_SERVER_PORT } from './fixture-server';
import { DEFAULT_DAPP_SERVER_PORT } from './fixture-helper';

function transformToValidPort(defaultPort, pid) {
// Improve uniqueness by using a simple transformation
const transformedPort = (parseInt(pid, 10) % 100000) + defaultPort;

// Ensure the transformed port falls within the valid port range (0-65535)
return transformedPort % 65536;
}

function getServerPort(defaultPort) {
if (process.env.CI) {
return defaultPort + (parseInt(process.pid, 10) % 10);
return transformToValidPort(defaultPort, process.pid);
}
return defaultPort;
}

export function getGanachePort() {
return getServerPort(DEFAULT_GANACHE_PORT);
const port = getServerPort(DEFAULT_GANACHE_PORT);
return port;
}

export function getFixturesServerPort() {
return getServerPort(DEFAULT_FIXTURE_SERVER_PORT);
const port = getServerPort(DEFAULT_FIXTURE_SERVER_PORT);
return port;
}

export function getLocalTestDappPort() {
return getServerPort(DEFAULT_DAPP_SERVER_PORT);
const port = getServerPort(DEFAULT_DAPP_SERVER_PORT);

return port;
}
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/approve-default-erc20.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import FixtureBuilder from '../../fixtures/fixture-builder';
Expand All @@ -17,7 +17,7 @@ const HST_CONTRACT = SMART_CONTRACTS.HST;
const WEBVIEW_TEST_DAPP_APPROVE_TOKENS_BUTTON_ID = 'approveTokens';
const EXPECTED_TOKEN_AMOUNT = '7';

describe(Regression('ERC20 tokens'), () => {
describe(Smoke('ERC20 tokens'), () => {
beforeAll(async () => {
jest.setTimeout(170000);
if (device.getPlatform() === 'android') {
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/eth-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Eth Sign'), () => {
describe(Smoke('Eth Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/personal-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Personal Sign'), () => {
describe(Smoke('Personal Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-erc20-with-dapp.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import FixtureBuilder from '../../fixtures/fixture-builder';
Expand All @@ -16,7 +16,7 @@ const HST_CONTRACT = SMART_CONTRACTS.HST;
const SENT_TOKENS_MESSAGE_TEXT = root.transactions.sent_tokens;
const WEBVIEW_TEST_DAPP_TRANSFER_TOKENS_BUTTON_ID = 'transferTokens';

describe(Regression('ERC20 tokens'), () => {
describe(Smoke('ERC20 tokens'), () => {
beforeAll(async () => {
jest.setTimeout(170000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-erc721.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import TabBarComponent from '../../pages/TabBarComponent';
Expand All @@ -13,7 +13,7 @@ import {
import root from '../../../locales/languages/en.json';
import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';

describe(Regression('ERC721 tokens'), () => {
describe(Smoke('ERC721 tokens'), () => {
const NFT_CONTRACT = SMART_CONTRACTS.NFTS;
const SENT_COLLECTIBLE_MESSAGE_TEXT = root.transactions.sent_collectible;
const WEBVIEW_TEST_DAPP_TRANSFER_FROM_BUTTON_ID = 'transferFromButton';
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-eth.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

import AmountView from '../../pages/AmountView';
Expand All @@ -17,7 +17,7 @@ import {
} from '../../fixtures/fixture-helper';
import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';

describe(Regression('Send ETH'), () => {
describe(Smoke('Send ETH'), () => {
const TOKEN_NAME = root.unit.eth;
const AMOUNT = '0.12345';

Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/typed-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Typed Sign'), () => {
describe(Smoke('Typed Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down
Loading