Граф коммитов

339 Коммитов

Автор SHA1 Сообщение Дата
dschom 72b68f95bb
bug(ci): Fix broken stage/prod smoke tests
Because:
- In train-266 stage smoke tests failed because the auth-client build was missing
- The auth client used to be part of the docker image, but this changed now that we cache builds in nx.

This Commit:
- Builds auth client with nx prior to running smoke tests.
2023-08-30 17:10:51 -07:00
dschom 5f5700a5ed
task(ci): Fix train 266 issues
Because:
- Fixes projects param on integration tests in flows other than test_pull_request
- Defaults to large resource class for integration tests (for now)
2023-08-30 13:30:16 -07:00
dschom d96797ae6a
task(CI): Improve nx caching for CI pipelines
Because:
- Not all CI operations where taking advantage of NX caches

This Commit:
- Adjusts nx.json config to ensure correct caching behavior
- Adjusts nx.json config to ensure proper target chains. ie build is dependent on pre-build
- Uses nx to directly run integration tests
- Uses nx to directly run unit tests
- Phases out dependency on generated .list files
- Ensures 'start up' for services for functional tests is done with nx and uses nx caches.
- Creates nx tags to facilitate test commands
- Fixes linter errors encountered
- Updates docker images to nx for builds
- Updates nx ignore files
2023-08-29 11:19:54 -07:00
Ben Bangert 54f0c2e7a2
chore: update to TS to 5.2.2 and Node to 18.17.1
Because:

* We want to use the latest typescript features.

This commit:

* Updates to TypeScript 5.2.2.
* Updates to Node 18.17.1 as OOM would occur frequently with 18.14.
* Updates CI to use a large instance with increased memory for Node.
2023-08-28 14:47:29 -07:00
Reino Muhl 9c1afee646
feat(carts): refactor cart manager to match layers
Because:
- Refactor the Cart Manager to serve as higher level logic for the
  cart db model.

This commit:
- Removes service level logic.
- Adds common methods to be used by Cart Manager consumers.
- Adds checks for valid state by action and valid state transitions.
- Reverts playwright tests back to xlarge instance size

Closes FXA-8128
2023-08-15 18:03:36 -04:00
Barry Chen 00157e2d30
chore(ci): use large instances for functional tests 2023-08-10 16:13:26 -05:00
dschom 535498214a
task(many): Switch nx test target to be test-unit
Because:
- The CI already targets test-unit
- We want to draw a distinction between unit and integration tests.

This Commit:
- Renames "test" to "test-unit" in lib packages.
- Sets up CI to run integration tests on 'libs' folder packages
- Adds tags to nx projects in libs folder
2023-08-03 15:38:16 -07:00
Reino Muhl 432e3b8d2b
feat(shared): hide fluent warning msgs in tests
Because:

* Fluent warning messages are slowing down tests.

This commit:

* Updates to the latest @fluent/react version
* Adds a non-console.warn reportError to testing ReactLocalization
  instantiations.

Closes #FXA-7958
2023-08-01 20:08:50 -04:00
Valerie Pomerleau 747df5b722
fix(CircleCI): Increase playwright resource class to xlarge
Because:

* Resubscription tests were failing/flaking

This commit:

* Increase the playwright functional test resource class from large to xlarge.

Closes #
2023-07-19 15:16:49 -07:00
Ankita Shrivastava 22b4af980f
Merge pull request #15542 from mozilla/remove-old-tests
remove all the content-server tests from the config file
2023-07-19 12:33:26 -04:00
Ankita Shrivastava c447c543b4
remove all the content-server tests from the config file 2023-07-19 12:19:11 -04:00
Dan Schomburg 9ba5511aa8
Merge pull request #15524 from mozilla/FXA-7634
task(settings): Port oauth redirect logic to reset password flows
2023-07-18 13:52:36 -07:00
dschom b646df5721
task(settings): Port oauth redirect logic to reset password flows
Because:
- We want to enable password reset using our react app.

This commit:
- Ports over oauth reset password for react
- Updates Playwright tests accordingly
    - Ports over playwright tests covering typical reset password flows
    - Adds playwright test for PKCE reset password case
    - Adds playwright test for TOTP reset password case
    - Adds playwright test for account recovery code reset password case
    - Adds playwright test for account recovery code & TOTP reset password case
- Enables oauth redirect logic, and removed short circuit operation in router.js -> showReactApp that would prevent oauth routes from rendering.
- Applied oauth redirect logic to:
   - CompleteResetPassword page
   - AccountRecoveryResetPassword
- Fixes issues with displaying service name in:
    - ResetPasswordWithRecoveryKeyVerified
    - ResetPasswordVerified,
- Fixes issues with rendering story book state
- Fixed issues found in hooks:
    - Switched CreateReliers and CreateIntegration to useReliers and useIntegration. These accessed context so it turns out they really should be hooks.
    - Made these hooks return singletons, which fixed a bunch of ‘ghost’ rerenders.
- Fixed an intermittent race condition in url-query-data.ts and added an option to ‘synchronize’ a data store.
- Updated logic in RelierFactory.initOuathReliers to ensure all the relying party information needed for password reset could be resolved.
- Fixed call to account.resetPassword on ResetPassword page, so proper options were sent to auth so state would be reflected in email link.
- Added support for handling resume tokens. Resume tokens on base64 encoded in the resume field in the query string. The logic for parsing these tokens wasn’t present yet.
- Updated the integration factory to pass in a relier authClient. These were needed to handle the integration logic.
- Ported scoped keys logic.
- Clean up in tests:
    - Moved commonly used function, getReactFeatureFlagUrl to a util file.
    - Removes incorrect usages of act blocks in favor of 'findBy' calls
    - Wraps events in 'act' block that require it thereby fixing 'act' warnings
    - Mocks console.warn to silence data provider output
    - Test fxa-settings:test-integration output is now 100% percent clean, with no more warnings!
2023-07-18 13:25:41 -07:00
Meghan Sardesai 2598733ed9
feat(payments): update PlanUpgradeDetails content
Because:

* We need to show the customer what is owed and when (i.e. proration) on checkout.

This commit:

* Updates PlanUpgradeDetails component and invoice preview to include proration amount.
* Adds a helper function to formats for only plan intervals.
* Shows updated content when useStripeImmediatelyInvoice flag is set to true.
* Updates tests and stories when aforementioned flag is set to true, where applicable.

Closes FXA-6878
2023-07-18 13:49:22 -04:00
dschom df7897920d
task(gql-api): Allowlist graphql queries
Because:
- We want to lock down our gql queries as part of good security practices.

This Commit:
- Creates task that extracts existing gql queries from our code
- Applies middleware that checks a allowlist of extracted queries.
- Creates a 403 if the query is not in the allowlist
- Makes all gql parsable by extraction utility. The extraction utility doesn't support string placeholders. e.g. gql` Account { ${ACCOUNT_FIELDS} }`
- Moves all the gql in the admin server into .ts files. Again for consistency and extraction utility support.
- Cleans up some config references at startup
- Adds nx config for extraction & copy tasks
2023-07-18 05:54:28 -07:00
Valerie Pomerleau 597aa98d7d
test(functional-tests): Update functional tests for new recovery key flow
Because:

* We need to update the playwright tests to support the new account recovery key flow

This commit:

* Update recoveryKey page model
* Update misc, password and recoveryKey functional tests with feature flagging

Closes #FXA-7250
2023-05-24 08:08:59 -07:00
Dan Schomburg b9f3f51331
Merge pull request #15197 from mozilla/config-smoke-test-urls
task(CI): Make smoke test URLs configurable
2023-05-23 17:56:49 -07:00
dschom 46496b5b27
task(CI): Make smoke test URLs configurable
Because:
- We want to try running smoke tests against a new environment

This Commit:
- Adds pipeline parameters for configuring standard domains
- Transfers pipeline parameters to a set of standard envs
- Updates playwright tests to use these envs
- Updates functional content server tests to use these envs
2023-05-23 17:14:30 -07:00
Julian Poyourow 565ebb89c9
chore(build): initial nx implementation
Because:

* We want to introduce nx to the repository

This commit:

* Adds nx with working builds

Closes: FXA-7341

Co-authored-by: dschom <dschomburg@mozilla.com>
2023-05-23 08:37:47 -07:00
dschom ab187d4a5b
task(fxa-settings): Fix linter errors
Because:
- We want all projects to pass cleanly

This Commit:
- Fixes issue where the linter was linting the build directory. This fixed the bulk of the issues.
- Fixes the remaining actual linter errors.
- Removes lint-packages.sh in favor of inline command in circleci config
2023-05-22 13:56:21 -07:00
Dan Schomburg e3300d6d52
Merge pull request #15293 from mozilla/FXA-7333
task(many): Investigate adding auth to redis connection
2023-05-17 11:28:49 -07:00
dschom c7995188d0
task(many): Investigate adding auth to redis connection
Because:
- We want a poc that auth can be added to redis

This Commit:
- Configures all configs to support a redis password
- Sets the standard env for redis auth to REDIS_PASSWORD
- Creates a default redis password of 'fxa123' for local dev
- Starts redis container with --requirepass fxa123
2023-05-12 16:22:38 -07:00
dschom d97b7c3fe2
task(CI): Enable rerun of only failed tests
Because:
- For tests that are potentially flaky we want to enable the 'rerun only failed' circleci option

This Commit:
- Adjusts playwright tests to support 'rerun only failed'
2023-05-12 14:54:01 -07:00
dschom b4cfc9c325
chore(CI): Switch to multi stage docker build and clean up
Because:
- We want to clean up our docker build
- We no longer used our service specific images

This Commit:
- Switches to multi stage docker build
  - Removes unused building of individual services
  - Removes used script that sets environment variables.
  - Removes `workspaces focus` call that resulted in redundant installs
  - Removes trap on build logs.
  - Uses circleci DLC to get cache hits for fxa-utils and fxa-build-utils
- Removes scripts that build service specific images
- Cleans up naming conventions to reflect that only one image is being built
2023-05-11 17:13:06 -07:00
Vijay Budhram ce69c2753d
Merge pull request #15252 from mozilla/remove-stage-runs-from-prod-deployments
remove stage runs from prod deployments
2023-05-10 13:11:16 -04:00
Ankita Shrivastava ab488f9798
remove content server tests 2023-05-10 12:28:32 -04:00
Ankita Shrivastava 0b74d866e5
add content server tests to prod smoke suite 2023-05-10 12:16:45 -04:00
Lauren Zugai e4194f4339
task(react): Update feature flag names, modify local.json-dist
Because:
* We cancelled the React port of post_verify add recovery key routes and post_verify add secondary email routes and deemed 'push' routes out of scope (see tickets for details), so our feature flags needed some tweaking
* simpleRoutes are rolled out to 100% in production and updating local.json-dist to match keeps local dev in sync

closes FXA-6647
2023-05-09 17:54:03 -05:00
Ankita Shrivastava df471cf849
remove stage runs from prod deployments 2023-05-03 16:15:29 -04:00
dschom 8d6f2598f4
bug(CI): Fix deploying image tag
Because:
- If the image wasn't present locally, the deploy would simply skip the push.

This Commit:
- Checks to see if the target image tag is present on the remote docker registry.
- Pulls the target image the from the registry and then pushes it with the correct tag.
2023-05-01 17:15:19 -07:00
dschom 47a13e6e35
task(CI): Resolve linter OOM
Because:
- We were running out of memory.
- We recently increased the scope of linter coverage, which is likely related.

This Commit:
- Bumps the resource class for lint jobs.
2023-04-18 13:59:34 -07:00
Vijay Budhram 068f6f17e5
Merge pull request #15168 from mozilla/playwright-large
fix(test): Playwright with large instance but less workers
2023-04-13 22:28:53 -04:00
Vijay Budhram f3cfaef386
fix(test): Playwright with large instance but less workers 2023-04-13 22:01:19 -04:00
Dan Schomburg 24f36c9e3e
Merge pull request #15143 from mozilla/dockerpush-FXA-7141
task(ci): Allow docker build phase to happen in parallel
2023-04-13 15:00:00 -07:00
dschom 82d0cef27a
task(many): Enable eslint and fix linting errors
Because:
- Not all workspaces were configured for linting
- Not all workspaces passed linting

This Commit:
- Makes sure the lint command runs all workspaces
- Applies standard eslint config across the board
- Fixes as many linting errors as possible
- Follows still needed for payments, settings & functional tests
2023-04-13 14:19:17 -07:00
Wil Clouser b754f493d5
Merge pull request #15164 from mozilla/testcircle
make test_and_deploy_tag run on xlarge circleci instance
2023-04-12 16:52:51 -07:00
Wil Clouser 7a8ca3bc3b
make test_and_deploy_tag run on xlarge circleci instance 2023-04-12 16:40:06 -07:00
dschom 261f58a299
task(ci): Allow docker build phase to happen in parallel
Because:
- We can build the docker image while tests are running
- This will cut down on deploy time

This commit:
- Builds the deployed docker images in parallel to tests
- Pushes temporary image to docker up
- Once tests finish re-tags temporary image and pushes to docker hub
- Removes temporary build image from docker hub
2023-04-12 08:31:08 -07:00
Valerie Pomerleau 60e2e9c214
fix(fxa-settings): Show retryAfter value in error when resetPassword is throttled
Because:

* We want to show the retryAfterLocalized value in localized error messages when ResetPassword requests are throttled (maxEmails reached)

This commit:

* Add retryAfter and retryAfterLocalized from Auth server errors to GraphQl errors
* Make this value available to the localized throttled error message for the ResetPassword page.
* Add ResetPassword stories to show error examples.
* Enable customs-server by default in dev environment, but disable for CircleCi builds.
* Add documentation explaining how to disable/enable customs-server for local testing.
* Use ipv4 for the customs-server localhost (prevent from using ipv6, favoured by Node18)

Closes #FXA-6875
2023-04-11 15:23:50 -07:00
Barry Chen 29e957f185
chore(ci): use xlarge for nightly Playwright tests 2023-04-07 10:10:45 -05:00
Vijay Budhram 831c4dffe8
Merge pull request #15122 from mozilla/flaky-test-test
fix(tests): Add some tweaks to reduce flaky playwright tests
2023-04-05 23:43:45 -04:00
Vijay Budhram 6e45010bc4
fix(tests): Add some tweaks to reduce flaky playwright tests 2023-04-05 22:16:34 -04:00
Dan Schomburg 89d30fb047
Merge pull request #15110 from mozilla/dont-fail-fast-for-compile
task(ci): Build all packages but don't fail fast
2023-04-05 12:16:50 -07:00
dschom 86d883049f
task(ci): Build all packages but don't fail fast
Because:
- We want to start tracking build errors on all packages
- We should create urgency around fixing typescript build errors

This Commit:
- Removes any typescript compile exclusions
- Disabled the 'fail-fast' step for compile jobs
- Fixes content-server typescript compilation errors
- Disabled typescript compilation on test files in payments. A follow has been filed here.
2023-04-05 11:32:08 -07:00
dschom 30a71a03be
task(all): Remove ':' characters from npm targets
Because:
- A ':' character indicates that a script is globally available

This Commit:
- Converts : to -
2023-03-29 17:15:51 -07:00
dschom 27dc5aec6f
task(ci): Allow smoke tests on tags
Because:
- Smoke tests could be triggered on branches but not on tags

This Commit:
- Applies filters such that smoke tests can be run on tags.
- Applies filters such that smoke tests can be run on branches.
2023-03-28 15:09:07 -07:00
Vijay Budhram 2c471c00b1
feat(password): Add functionality to decrypt a user's recoveryKeyData, update tests 2023-03-27 12:26:30 -04:00
Barry Chen d19abe123d
fix(CI): allow image rebuild pipeline param 2023-03-21 10:32:23 -05:00
Barry Chen 902762c5d6
fix(CI): install deps before requiring in script
Because:
 - we should install packages before requiring them in scripts

This commit:
 - run base install first
 - originally part of commit 0d82821
2023-03-20 18:18:20 -05:00
Barry Chen da11e63832
chore(deps): upgrade to node.js 18
Because:
 - we want to use the latest node LTS major version

This commit:
 - upgrades FxA to use node 18, with two workarounds
   - Webpack uses a hash algorithm that's no longer supported by default
     in node 17+, causing build failures; --openssl-legacy-provider is
     used as the workaround
   - dns.lookup in node 17+ by default returns the results in the same
     order as they are from the resolver, which could lead to
     'localhost' resolving to ::1; --dns-result-order=ipv4first is used
     as the workaround
2023-03-20 13:28:10 -05:00
Vijay Budhram 774e83af54
fix(tests): Fix compile issues in services 2023-03-20 13:06:07 -04:00
Meghan Sardesai 5eee424611
Revert "Train 254.2" 2023-03-16 17:00:51 -04:00
Meghan Sardesai da103724f6
Merge pull request #15047 from mozilla/train-254-uplift-2
Train 254.2
2023-03-16 16:51:29 -04:00
dschom cd6f0d3e24
task(ci): Add compile CI job to catch TS errors
Because:
- TypeScript errors were occurring during the docker build of the deploy workflow
- We want to catch typescript errors as early as possible

This Commit:
- Adds compile job, that runs tsc --noEmit across all workspaces
2023-03-16 11:38:57 -07:00
dschom 0d828216d3
fix(ci): Don't clone on postinstall create lists after base install. 2023-03-15 17:01:21 -07:00
Dan Schomburg 2fdd96107f
Merge pull request #15018 from mozilla/FXA-6463
task(many): Only clone l10n once and combine ftl files.
2023-03-15 12:47:03 -07:00
dschom 1d709000fe
task(many): Only clone l10n once and combine ftl files.
Because:
- We want to avoid redundant git clone operations
- We want to reduce the number of ftl bundles requested on the client side.

This Commit:
- Adds _scripts/l10n/*.sh for conducting l10n build operations
- Bundles ftl files together into ftl main
- Removes bundle prop on AppLocalizer, so that it uses the default, [main.ftl]
- Replace - with _ in locale names when resolving ftl files
- Removes clone-l10n.sh
2023-03-15 11:30:44 -07:00
Barry Chen 2b2fada774
chore(repo): delete support panel from fxa
Because:
 - the support panel has been replaced by features in the admin panel

This commit:
 - deletes the support panel package
2023-03-14 10:49:43 -05:00
Dan Schomburg 69ea4c75b2
Merge pull request #14955 from mozilla/updates-for-parallel-smoke-tests
task(CI): Updates to better support parallel smoke tests
2023-03-09 11:30:39 -08:00
dschom 1e3f1b9877
task(CI): Updates to better support parallel smoke tests
Because:
- We want to run smoke tests in parallel for faster deployments.

This Commit:
- Adds pipeline flags required to support remote execution of pipelines
- Updates readme
2023-03-08 09:55:52 -08:00
Vijay Budhram 80a804e13a
fix(test): Use `newPagesForSync` in flaky tests and disable coppa 2023-03-08 09:38:01 -05:00
Dan Schomburg 19e99228e6
Merge pull request #14893 from mozilla/improve-output-in-run-list-parallel
task(CI): Improve output in run-list-parallel
2023-03-02 10:37:39 -08:00
Ivo Plamenac 0d78fd51fb
fixing merge conflicts of train-252 to main 2023-02-22 11:43:32 -08:00
dschom 3619e7a9cd
task(CI): Fix bash warnings coming from run-list-parallel
Becuase:
- Bash warnings were being printed out in the CI.

This Commit:
- Changes syntax to address warnings.
2023-02-17 15:52:15 -08:00
dschom 41d06466a3
task(CI): Improve output in run-list-parallel
Because:
- We had some scenarios where we see anything written to stdout

This Commit:
- Applies the --ungroup option, which allows stdout to be written in realtime.
- Only does this when max parallel jobs is set 1
- Prints the actual operations being run to stdout for easier debugging
2023-02-17 15:50:48 -08:00
dschom da3730f63a
task(ci): Experiment with increased integration test runners. 2023-02-17 13:04:48 -08:00
Dan Schomburg 7c1df8f477
Merge pull request #14879 from mozilla/exp-increase-integration-tests
task(ci): Experiment with increased integration test runners.
2023-02-16 17:45:33 -08:00
dschom bef3667aaa
task(ci): Disable fail-fast step for integration tests 2023-02-15 15:54:49 -08:00
dschom 515770a45c
task(ci): Experiment with increased integration test runners. 2023-02-15 09:03:23 -08:00
Vijay Budhram 1882c9b7b1
task(shared): Make opentelemetry only update patches 2023-02-09 10:58:05 -05:00
Dan Schomburg 5a1a1ed2cc
Merge pull request #14827 from mozilla/train-251
Release 1.251.0
2023-02-08 10:25:02 -08:00
dschom 8650f216bf
task(CI): Add back in build story book
Becuase:
- Storybook was removed from the test pr workflow and needs to be restored.

This Commit:
- Adds storybook back into the the test pr workflow.
2023-02-06 11:53:33 -08:00
dschom 9d2a0f5f33
task(CI): Remove nightly workflow
Because:
- This workflow triggered an error when the test-content-server-remote job was invoked with CircleCI api V1
- It appears this is caused by a bug in the CircleCI V1 api (https://github.com/CircleCI-Public/slack-orb/issues/148)

This Commit:
- Temporarily disables the nightly workflow
2023-02-02 14:58:31 -08:00
dschom 22e8f04e37
bug(ci): Fix test_and_deploy_tag workflow
Because:
- Not all jobs were running in the test_and_deploy_tag

This Commit:
- Adds filter configs to each job. This typically isn't necessary, but since we
  ignore all branches, in this case it is.
2023-02-01 15:32:57 -08:00
dschom 4b05dfea94
bug(ci): Fix test_and_deploy_tag workflow
Because:
- Not all jobs were running in the test_and_deploy_tag

This Commit:
- Adds filter configs to each job. This typically isn't necessary, but since we
  ignore all branches, in this case it is.
2023-02-01 14:45:06 -08:00
dschom 6030c30adf
task(ci): Fix checkout 2023-02-01 13:07:01 -08:00
Dan Schomburg edd312c12b
Merge pull request #14817 from mozilla/ci-improvements-part-2
task(CI): Improvements to caching and startup behaviors
2023-02-01 07:56:16 -08:00
Vijay Budhram 53977c4f7b
fix(react): Add playwright tests for react conversion 2023-01-31 13:39:48 -05:00
dschom 8d3e42963f
task(CI): Improvements to caching and startup behaviors
Because:
- Something was off for base-install in jobs using the ci-base-browser-latest images. Yarn cache hits were not happening as anticipated. Also, in the event the yarn install could be skipped, the postinstall script was taking longer than expected.
- An occasional race condition where the deploy-fxa-ci-browser-image could be built off a stale base image was detected.
- Since ci-base-latest and ci-base-browsers-latests weren’t pushed at the same time, occasionally different builds would be used in a pipeline. Although this never directly led to problems, it did seem like the potential was there.
- The ci-* docker images were larger than desired..
- While investigating optimizations, it became apparent job spin up times could be further reduced by using CircleCI workspaces.
– Nightly builds are useful, and we would occasionally encounter a regression on main that wasn’t present in PRs due to differences in resulting state after a merge.
- SRE needs a better way to trigger smoke tests in parallel.

This commit:
- Reworks the docker file.
	- Puts everything into one multi stage build, which results in better layer caching.
	- Creates new tag names ci-builder, ci-test-runner, & ci-functional-test-runner
       - Makes sure these images are as small as possible
	- Updates references to these new images in the executors
- Ensures that the ci images are built on the same machine and pushed at the same time. This addresses the potential race condition described in the because section above.
- Short circuits the docker build for ci images if there are no npm package changes detected. Since the base images are really just a way to decrease build time by caching package dependencies in a docker image that compresses better than the circle ci cache, we don’t actually need to build the image unless a package change has occurred.
- Leverages CircleCI workspaces. The build now primes the workspace and it is then restored in the subsequent jobs. This ends up saving time, because we skip the build / install step, and it allows us to use much smaller docker images for any job running post build.
- Adds a script to extract the current state of the yarn cache from a docker image, so the yarn cache can be kept fresh. This was an oversight in the initial pass.
- For functional tests, the operation that starts the pm2 stack and the actual jobs have been separated into different steps. This gives us better timing metrics, and also lets us see which step fails most often. Starting the stack actually takes up a considerable amount of time, and shouldn’t be confused with the time it takes to execute tests.
- For functional tests (both playwright and content), a memory optimization was made by not including fxa-shared or fxa-react in the ‘run start’ operation. Both of these workspaces are now built in the ‘build’ stage, so there is no reason to include them when spinning up the stack. This actually resulted in a noticeable reduction in memory usage. This is probably due to the fact that these pm2 tasks were running a watch operation, which is more memory intensive than just running a build.
- Ensures that the entire git history isn't copied into the base image, which results in a smaller image. (Our git history is surprisingly large!) This is done by setting a depth of 1 when cloning and depth of 2 when fetching. These changes also address FXA-6676, because the clone and fetch operations have been modified.
- Adds a nightly workflow, so that we can run a full test suite to guard against regression resulting from a merge into main. See FXA-6626 for more information. We can also use this nightly flow to postpone any CI tasks that run on main, but aren’t urgent.
- Retains the ability to manually trigger tasks that were shifted to the nightly workflow. These tasks include deploying storybook or deploying packages.
- Adds the ability to trigger smoke test workflows with pipeline parameters. It’s possible this will simplify executing smoke tests in parallel for SRE.
- Fixes the issue of slow base-install script performance when the yarn install operation could be skipped. The issue was that when we invoke postinstall directly, fxa-shared would be built. This is already taken care of in the build step, so doing so in the base install was an unneeded redundancy.
- Adds a few other minor improvements fixes such as avoiding a couple redundant build / lint operations, making the build script a bit more robust, and cleaning up the config file a bit.
2023-01-30 13:14:13 -08:00
dschom afc47ef8b3
bug(CI): Fix edge case where there are fewer operations than groups
Because:
- When there was just a single integration test suite to run, the second integration test suite in the ci would fail.

This Commit:
- Checks to make sure the split file exists before running it.
2023-01-27 13:49:48 -08:00
Reino Muhl 5b9677b0ab
fix(CI): initialize empty lists
Because:
- There is logic to gracefully exit when an operations list is empty.

This Commit:
- Creates an empty file when operations lists are created.

Closes: FXA-6701
2023-01-25 16:59:03 -05:00
dschom 64569556c9
task(CI): Parallel job cancellation
Because:
- We want to shut down jobs

This Commit:
- Terminates tests suites early if unit or integration tests fail.
2023-01-25 09:03:40 -08:00
Dan Schomburg 4487a56357
Merge pull request #14786 from mozilla/FXA-6681
task(CI): Fix case when test list is empty
2023-01-23 13:28:01 -08:00
dschom 09ece40fd5
task(CI): Phase out setting servers tests
Because:
- The settings server functional tests have all been moved to playwright.
- The settings server integration tests run in the integration tests suites now.

This Commit:
- Phases out the settings server functional tests.
2023-01-20 15:51:35 -08:00
dschom 15f89a6750
task(CI): Fix case when test list is empty
Because:
- Code would error out if the operations list was empty.
- Code should gracefully exit if asked to run an empty list of operations.

This Commit:
- Gracefully exists when operations list is empty
2023-01-20 14:46:50 -08:00
dschom a80730406f
fix(ci): Disable docker layer caching
Because:
- We've been seeing some odd behavior were 'stale' images are getting used in some cases.

This Commit:
- Disables docker layer caching for now. This seems like the safest thing to do until we fully understand what's happening in FXA-6624
2023-01-18 13:23:05 -08:00
dschom a620922422
task(CI): build, unit test, and integration test jobs
Because:
- We wanted to run a few preliminary checks before proceeding to more
  expensive CI jobs. Checks include:
    - Compiling typescript in commonly referenced workspace packages
    - Linting code that has changed
    - Executing Unit Tests for code that has changed
- We wanted to partition test operations into unit tests, and
   integration tests. Unit tests can be run relatively quickly and
   require no additional infrastructure. Integration tests require
   additional infrastructure and generally have longer execution
   times. Now that jobs are blocked from running until preliminary
   checks pass, one of which is unit tests, it is important to draw a
   distinction between these two types of tests.
- We want to avoid unnecessary yarn installs and typescript
  compilations, which are time consuming.
- We want to make sure that test results are published and failing tests
   can be easily viewed in the CI.

This Commit:

- Creates a build-and-validate job in the CI that builds, lints, and
  unit tests code prior to running any other jobs.
- Creates unit-test job in CI config
- Creates integration-test job in CI config
- Removes redundant calls to compile workspace packages. These
  are now built up front, cached, and restored as needed for future
  runs.
- Extends the create-lists script functionality to generate commands
  that can be executed with the parallel command.
- Removes unnecessary yarn install operations. Invoking yarn workspace
   focus results in a yarn install. In the case of running tests this is largely
   unnecessary, because we already do a yarn install in the base-install
   step.
- Make sure test results are exported as junit xml so the CI can report
  back on tests that were failing. This was done for a couple workspace
  packages, but many were lacking the capability. All test:unit and
  test:integration npm scripts now export this data.
- Fixes the following issues encountered along the way:
        - Adds logs to monitor heap usage of jest tests. Some
          jest tests are still using a lot of memory.
        - Moves a few slow / long running tests from unit test to
          integration tests.
        - Ensures that jest.transform for ts-jest is always instructed
           to have the config option isolateModules is set to true. This
           definitely decreases memory overhead and resolves some
           of the OOM errors we were hitting. It was configured in
           some places but not everywhere.
        - Exports test results files for all tests
        - Exports all test artifacts
        - Uses gnu parallel to run tests in parallel. Turns out yarn
          workspaces foreach would give a false positive when an OOM
          was encountered. Fortunately, the parallel command offered an
          acceptable work around, and even offers some nice features
          like the load argument, which allows to control test execution a
          bit more efficiently.
2023-01-10 12:52:01 -08:00
dschom 12779b14ee
bug(CI): test-content-server-remote must not have parameters
Because:
- We cannot add parameters to job triggered through circleci's API

This Commit:
- Removes parameters from the `test-content-server-remote` job
2022-12-22 10:15:55 -08:00
dschom 9ca315981c
fix(CI): Fix failing tests due to missing types
Because:
- The graphql api didn't startup properly. It appears down stream packages were not built.

This Commit:
- Ensures common packages are built.
2022-12-21 10:51:00 -08:00
Dan Schomburg ad11a9cd73
Merge pull request #14674 from mozilla/FXA-6264
task(ci): Run content server smoke tests in parallel
2022-12-21 10:14:28 -08:00
dschom ca89b51f9b
task(ci): Run content server smoke tests in parallel
Because:
- We want decrease the time it takes to deploy

This Commit:
- Adds ability to divide smoke tests
- Creates jobs that divide content server smoke tests into three parts
- Jobs can be run in parallel
- Creates a new executor for running smoke tests
- Removes mozinstall command (found in test-ci-remote.sh) since there is already a firefox browser installed in the base image
- Removes internjs argument --firefoxBinary, because there is now a firefox binary available in /usr/local/bin/firefox.
2022-12-21 09:59:05 -08:00
Vijay Budhram 1a5feea97b
Merge pull request #14658 from mozilla/try-ci-changes
fix(tests): Lower number of content-server test executors and increase instance size
2022-12-21 12:19:14 -05:00
dschom 74d474389c
bug(CI): Fixes the playwright install in the base image used for functional tests.
Because:
- Playwright tests weren't running

This Commit:
- Switches from to an npx install to setup the playwright browsers
2022-12-20 12:18:25 -08:00
Vijay Budhram 5b50225520
fix(tests): Lower number of content-server test executors and increase instance size 2022-12-20 13:11:41 -05:00
dschom acf3c82590
task(ci): Use docker base image
Because:
- We want to speed up pipeline startup.

This Commit:
- Optimizes docker base image builds for the smallest images possible.
- Enables hard links for yarn cache
- Enables global yarn cache
- Avoids needlessly installing playwright browsers.
- Avoids needlessly running yarn install.
- Uses mozilla/fxa-circleci:ci-base-latest image for running test pipelines
- Uses mozilla/fxa-circleci:ci-base-browsers image for running functional tests pipelines
- Creates configurable executors that can be reused across pipelines
- Upgrades to yarn 3.3.0
- Enabled direct check out of PR code to test, which is faster than circle ci’s checkout command.
- Upgrades functional test to X-Large. This was already the case for playwright tests, but is now extended to content server tests too. This decision was made due to running lots of pipelines and realizing flakiness was largely due to CPU or memory hitting 100% for long periods of time.
- Turns off tracing, since it saves a bit of runtime.
2022-12-15 15:48:16 -08:00
Ankita Shrivastava ef96fcbe30
Merge pull request #14542 from mozilla/run-subscription-tests-on-CI
Increase resource size and fix a few flaky tests and enable subplat tests to run on CircleCi
2022-11-30 09:05:03 -05:00
Ankita Shrivastava 553e3d41de
Increase resource size and enable subplat tests to run on local CircleCi 2022-11-28 15:42:15 -05:00
dschom 37aead86ae
task(ci): Enable docker layer caching
Because:
- We want to speed up build times

This Commit:
- Adds docker_layer_caching directive
- Makes sure buildkit is enabled where possible
2022-11-28 11:39:03 -08:00
Vijay Budhram 3e3a51cc9a
chore(deps): Update playwright docker to v1.28.0 2022-11-28 12:42:47 -05:00
Ankita Shrivastava c427ffb819
Merge pull request #14533 from mozilla/add-circleci-split
test(functional): add parallelism and circleci split to functional tests
2022-11-23 14:24:10 -05:00