Skip to content

Commit

Permalink
Merge from upstream
Browse files Browse the repository at this point in the history
Fixed failing tests

See: #13604
  • Loading branch information
radoslawkrzemien committed Aug 21, 2023
1 parent 4dd43c2 commit 7799937
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions workflow_tests/assertions/platformDeployAssertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ const assertIOSJobExecuted = (workflowResult, didExecute = true, isProduction =
{key: 'ruby-version', value: '2.7'},
{key: 'bundler-cache', value: 'true'},
]),
utils.createStepAssertion('Setup credentails for Mapbox SDK', true, null, 'IOS', 'Setup credentials for Mapbox SDK'),
utils.createStepAssertion('Install cocoapods', true, null, 'IOS', 'Installing cocoapods', [
{key: 'timeout_minutes', value: '10'},
{key: 'max_attempts', value: '5'},
Expand Down Expand Up @@ -204,6 +205,7 @@ const assertWebJobExecuted = (workflowResult, didExecute = true, isProduction =
{key: 'AWS_ACCESS_KEY_ID', value: '***'},
{key: 'AWS_SECRET_ACCESS_KEY', value: '***'},
]),
utils.createStepAssertion('Setup credentails for Mapbox SDK', true, null, 'WEB', 'Setup credentials for Mapbox SDK'),
];
if (isProduction) {
steps.push(
Expand Down
4 changes: 4 additions & 0 deletions workflow_tests/assertions/testBuildAssertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const assertAndroidJobExecuted = (workflowResult, ref = '', didExecute = true, f
],
[],
),
utils.createStepAssertion('Setup credentails for Mapbox SDK', true, null, 'ANDROID', 'Setup credentials for Mapbox SDK'),
utils.createStepAssertion(
'Run Fastlane beta test',
true,
Expand All @@ -98,6 +99,8 @@ const assertAndroidJobExecuted = (workflowResult, ref = '', didExecute = true, f
{key: 'S3_SECRET_ACCESS_KEY', value: '***'},
{key: 'S3_BUCKET', value: 'ad-hoc-expensify-cash'},
{key: 'S3_REGION', value: 'us-east-1'},
{key: 'MYAPP_UPLOAD_STORE_PASSWORD', value: '***'},
{key: 'MYAPP_UPLOAD_KEY_PASSWORD', value: '***'},
],
),
utils.createStepAssertion(
Expand Down Expand Up @@ -150,6 +153,7 @@ const assertIOSJobExecuted = (workflowResult, ref = '', didExecute = true, fails
],
[],
),
utils.createStepAssertion('Setup credentails for Mapbox SDK', true, null, 'IOS', 'Setup credentials for Mapbox SDK'),
utils.createStepAssertion(
'Install cocoapods',
true,
Expand Down
4 changes: 4 additions & 0 deletions workflow_tests/mocks/platformDeployMocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const PLATFORM_DEPLOY__DESKTOP__STEP_MOCKS = [
const PLATFORM_DEPLOY__IOS__CHECKOUT__STEP_MOCK = utils.createMockStep('Checkout', 'Checking out', 'IOS');
const PLATFORM_DEPLOY__IOS__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setting up Node', 'IOS');
const PLATFORM_DEPLOY__IOS__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setting up Ruby', 'IOS', ['ruby-version', 'bundler-cache']);
const PLATFORM_DEPLOY__IOS__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Setup credentails for Mapbox SDK', 'Setup credentials for Mapbox SDK', 'IOS');
const PLATFORM_DEPLOY__IOS__COCOAPODS__STEP_MOCK = utils.createMockStep('Install cocoapods', 'Installing cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command']);
const PLATFORM_DEPLOY__IOS__DECRYPT_PROFILE__STEP_MOCK = utils.createMockStep('Decrypt profile', 'Decrypting profile', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']);
const PLATFORM_DEPLOY__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = utils.createMockStep('Decrypt certificate', 'Decrypting certificate', 'IOS', null, ['LARGE_SECRET_PASSPHRASE']);
Expand Down Expand Up @@ -122,6 +123,7 @@ const PLATFORM_DEPLOY__IOS__STEP_MOCKS = [
PLATFORM_DEPLOY__IOS__CHECKOUT__STEP_MOCK,
PLATFORM_DEPLOY__IOS__SETUP_NODE__STEP_MOCK,
PLATFORM_DEPLOY__IOS__SETUP_RUBY__STEP_MOCK,
PLATFORM_DEPLOY__IOS__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK,
PLATFORM_DEPLOY__IOS__COCOAPODS__STEP_MOCK,
PLATFORM_DEPLOY__IOS__DECRYPT_PROFILE__STEP_MOCK,
PLATFORM_DEPLOY__IOS__DECRYPT_CERTIFICATE__STEP_MOCK,
Expand All @@ -142,6 +144,7 @@ const PLATFORM_DEPLOY__WEB__AWS_CREDENTIALS__STEP_MOCK = utils.createMockStep('C
'AWS_ACCESS_KEY_ID',
'AWS_SECRET_ACCESS_KEY',
]);
const PLATFORM_DEPLOY__WEB__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Setup credentails for Mapbox SDK', 'Setup credentials for Mapbox SDK', 'WEB');
const PLATFORM_DEPLOY__WEB__BUILD_PRODUCTION__STEP_MOCK = utils.createMockStep('Build web for production', 'Building web for production', 'WEB');
const PLATFORM_DEPLOY__WEB__BUILD_STAGING__STEP_MOCK = utils.createMockStep('Build web for staging', 'Building web for staging', 'WEB');
const PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_PRODUCTION__STEP_MOCK = utils.createMockStep('Build storybook docs for production', 'Build storybook docs for production', 'WEB');
Expand All @@ -155,6 +158,7 @@ const PLATFORM_DEPLOY__WEB__STEP_MOCKS = [
PLATFORM_DEPLOY__WEB__SETUP_NODE__STEP_MOCK,
PLATFORM_DEPLOY__WEB__CLOUDFLARE__STEP_MOCK,
PLATFORM_DEPLOY__WEB__AWS_CREDENTIALS__STEP_MOCK,
PLATFORM_DEPLOY__WEB__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK,
PLATFORM_DEPLOY__WEB__BUILD_PRODUCTION__STEP_MOCK,
PLATFORM_DEPLOY__WEB__BUILD_STAGING__STEP_MOCK,
PLATFORM_DEPLOY__WEB__BUILD_STORYBOOK_DOCS_FOR_PRODUCTION__STEP_MOCK,
Expand Down
6 changes: 5 additions & 1 deletion workflow_tests/mocks/testBuildMocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ const TESTBUILD__ANDROID__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK = utils.createMoc
['AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY'],
[],
);
const TESTBUILD__ANDROID__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Setup credentails for Mapbox SDK', 'Setup credentials for Mapbox SDK', 'ANDROID');
const TESTBUILD__ANDROID__RUN_FASTLANE_BETA_TEST__STEP_MOCK = utils.createMockStep(
'Run Fastlane beta test',
'Run Fastlane beta test',
'ANDROID',
[],
['S3_ACCESS_KEY', 'S3_SECRET_ACCESS_KEY', 'S3_BUCKET', 'S3_REGION'],
['S3_ACCESS_KEY', 'S3_SECRET_ACCESS_KEY', 'S3_BUCKET', 'S3_REGION', 'MYAPP_UPLOAD_STORE_PASSWORD', 'MYAPP_UPLOAD_KEY_PASSWORD'],
);
const TESTBUILD__ANDROID__UPLOAD_ARTIFACT__STEP_MOCK = utils.createMockStep('Upload Artifact', 'Upload Artifact', 'ANDROID', ['name', 'path'], []);
const TESTBUILD__ANDROID__STEP_MOCKS = [
Expand All @@ -88,6 +89,7 @@ const TESTBUILD__ANDROID__STEP_MOCKS = [
TESTBUILD__ANDROID__DECRYPT_KEYSTORE__STEP_MOCK,
TESTBUILD__ANDROID__DECRYPT_JSON_KEY__STEP_MOCK,
TESTBUILD__ANDROID__CONFIGURE_AWS_CREDENTIALS__STEP_MOCK,
TESTBUILD__ANDROID__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK,
TESTBUILD__ANDROID__RUN_FASTLANE_BETA_TEST__STEP_MOCK,
TESTBUILD__ANDROID__UPLOAD_ARTIFACT__STEP_MOCK,
];
Expand All @@ -104,6 +106,7 @@ const TESTBUILD__IOS__CREATE_ENV_ADHOC__STEP_MOCK = utils.createMockStep(
const TESTBUILD__IOS__SETUP_NODE__STEP_MOCK = utils.createMockStep('Setup Node', 'Setup Node', 'IOS', [], []);
const TESTBUILD__IOS__SETUP_XCODE__STEP_MOCK = utils.createMockStep('Setup XCode', 'Setup XCode', 'IOS', [], []);
const TESTBUILD__IOS__SETUP_RUBY__STEP_MOCK = utils.createMockStep('Setup Ruby', 'Setup Ruby', 'IOS', ['ruby-version', 'bundler-cache'], []);
const TESTBUILD__IOS__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK = utils.createMockStep('Setup credentails for Mapbox SDK', 'Setup credentials for Mapbox SDK', 'IOS');
const TESTBUILD__IOS__INSTALL_COCOAPODS__STEP_MOCK = utils.createMockStep('Install cocoapods', 'Install cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command'], []);
const TESTBUILD__IOS__DECRYPT_PROFILE__STEP_MOCK = utils.createMockStep('Decrypt profile', 'Decrypt profile', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']);
const TESTBUILD__IOS__DECRYPT_CERTIFICATE__STEP_MOCK = utils.createMockStep('Decrypt certificate', 'Decrypt certificate', 'IOS', [], ['LARGE_SECRET_PASSPHRASE']);
Expand All @@ -122,6 +125,7 @@ const TESTBUILD__IOS__STEP_MOCKS = [
TESTBUILD__IOS__SETUP_NODE__STEP_MOCK,
TESTBUILD__IOS__SETUP_XCODE__STEP_MOCK,
TESTBUILD__IOS__SETUP_RUBY__STEP_MOCK,
TESTBUILD__IOS__SETUP_CREDENTIALS_FOR_MAPBOX_SDK__STEP_MOCK,
TESTBUILD__IOS__INSTALL_COCOAPODS__STEP_MOCK,
TESTBUILD__IOS__DECRYPT_PROFILE__STEP_MOCK,
TESTBUILD__IOS__DECRYPT_CERTIFICATE__STEP_MOCK,
Expand Down
6 changes: 4 additions & 2 deletions workflow_tests/testBuild.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ describe('test workflow testBuild', () => {
CSC_KEY_PASSWORD: 'dummy_csc_key_password',
APPLE_ID_PASSWORD: 'dummy_apple_id_password',
APPLE_ID: 'dummy_apple_id_value',
MYAPP_UPLOAD_STORE_PASSWORD: 'dummy_myapp_upload_store_password',
MYAPP_UPLOAD_KEY_PASSWORD: 'dummy_myapp_upload_key_password',
};

beforeAll(async () => {
Expand Down Expand Up @@ -232,7 +234,7 @@ describe('test workflow testBuild', () => {
web: mocks.TESTBUILD__WEB__STEP_MOCKS,
postGithubComment: mocks.TESTBUILD__POSTGITHUBCOMMENT__STEP_MOCKS,
};
testMockSteps.iOS[5] = utils.createMockStep('Install cocoapods', 'Install cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command'], [], {}, {}, false);
testMockSteps.iOS[6] = utils.createMockStep('Install cocoapods', 'Install cocoapods', 'IOS', ['timeout_minutes', 'max_attempts', 'command'], [], {}, {}, false);
const result = await act.runEvent(event, {
workflowFile: path.join(repoPath, '.github', 'workflows', 'testBuild.yml'),
mockSteps: testMockSteps,
Expand All @@ -243,7 +245,7 @@ describe('test workflow testBuild', () => {
assertions.assertValidateActorJobExecuted(result, '1234');
assertions.assertGetBranchRefJobExecuted(result);
assertions.assertAndroidJobExecuted(result, 'test-ref');
assertions.assertIOSJobExecuted(result, 'test-ref', true, 5);
assertions.assertIOSJobExecuted(result, 'test-ref', true, 6);
assertions.assertDesktopJobExecuted(result, 'test-ref');
assertions.assertWebJobExecuted(result, 'test-ref');
assertions.assertPostGithubCommentJobExecuted(result, 'test-ref', '1234', true, 'success', 'failure', 'success', 'success');
Expand Down

0 comments on commit 7799937

Please sign in to comment.