Skip to content

feat: add displayLang test #5495

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

Merged
merged 8 commits into from
Aug 31, 2022
Merged

feat: add displayLang test #5495

merged 8 commits into from
Aug 31, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Aug 23, 2022

This PR adds an e2e test to ensure our language patch is working as expected.

7b3af0074186a31b540173c75758b033.webm

NOTE to self: won't pass with dev builds because lang. patch only works with prod builds. Might need to conditionally run this test.

Notes

When you install a language pack, two things happen:

  • the extension is unzipped to --extensions-dir (expected, same as other extensions)
  • it adds a file called languagepacks.json to ~/.local/share/code-server (see example gist)

That means in order for this test to pass consistently (without relying on a network connection), we need to add both of those things in global setup or in the test setup.

To test locally and just this test, I run this command:

CODE_SERVER_TEST_ENTRY="/usr/local/Cellar/code-server/4.6.0/libexec" yarn test:e2e --grep "load code-server in Spanish" --quiet

Fixes #5367

@jsjoeio jsjoeio self-assigned this Aug 23, 2022
@jsjoeio jsjoeio temporarily deployed to npm August 24, 2022 17:23 Inactive
@github-actions
Copy link

github-actions bot commented Aug 24, 2022

✨ code-server dev build published to npm for PR #5495!

  • Last publish status: success
  • Commit: 02a7fa8

To install in a local project, run:

npm install @coder/code-server-pr@5495

To install globally, run:

npm install -g @coder/code-server-pr@5495

@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #5495 (02a7fa8) into main (f9bfd58) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5495   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          30       30           
  Lines        1673     1673           
  Branches      366      366           
=======================================
  Hits         1212     1212           
  Misses        398      398           
  Partials       63       63           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9bfd58...02a7fa8. Read the comment docs.

@jsjoeio jsjoeio temporarily deployed to npm August 24, 2022 18:55 Inactive
@jsjoeio jsjoeio temporarily deployed to npm August 25, 2022 17:28 Inactive
@jsjoeio jsjoeio temporarily deployed to npm August 25, 2022 18:04 Inactive
@jsjoeio jsjoeio force-pushed the jsjoeio/lang-patch branch from c805159 to 3db2390 Compare August 29, 2022 18:06
This adds a slimmed-down version of the Spanish Language Pack and also
adds a `languagepacks.json` to the e2e `workspaceDir` which allows use
to run a test suite passing the `--locale es` flags to simulate a
different display language.
This tests loading code-server in Spanish using the `--locale` flag.
@jsjoeio jsjoeio force-pushed the jsjoeio/lang-patch branch from 3db2390 to 4452b71 Compare August 29, 2022 18:10
@jsjoeio jsjoeio marked this pull request as ready for review August 29, 2022 18:11
@jsjoeio jsjoeio requested a review from a team as a code owner August 29, 2022 18:11
@jsjoeio jsjoeio temporarily deployed to npm August 29, 2022 18:15 Inactive
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Aug 30, 2022

We should make sure anything we merge can be found in the open source. https://github.com/microsoft/vscode-loc/tree/main/i18n/vscode-language-pack-es (could also start from scratch and create our own)

Good call. I'll double-check that and/or explore starting from scratch.

I'm going to move this back to draft and address changes.

@jsjoeio jsjoeio marked this pull request as draft August 30, 2022 22:55
@jsjoeio jsjoeio temporarily deployed to npm August 30, 2022 22:59 Inactive
@jsjoeio jsjoeio marked this pull request as ready for review August 31, 2022 17:06
@jsjoeio jsjoeio requested a review from code-asher August 31, 2022 17:06
@jsjoeio jsjoeio temporarily deployed to npm August 31, 2022 17:12 Inactive
@jsjoeio jsjoeio temporarily deployed to npm August 31, 2022 17:38 Inactive
@jsjoeio jsjoeio merged commit 8a227d9 into main Aug 31, 2022
@jsjoeio jsjoeio deleted the jsjoeio/lang-patch branch August 31, 2022 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat]: add e2e test for display-language patch
2 participants