Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Restore project unit tests #965

Closed
10 tasks
brylie opened this issue Oct 12, 2021 · 16 comments · Fixed by #978
Closed
10 tasks

Restore project unit tests #965

brylie opened this issue Oct 12, 2021 · 16 comments · Fixed by #978
Assignees
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix Hacktoberfest Ideal for Hacktoberfest participation hacktoberfest-approved Tasks and pull requests that are approved for Hacktoberfest. help wanted Open to participation from the community internship In the scope of the internship 🟧 priority: high Stalls work on the project or its dependents

Comments

@brylie
Copy link
Contributor

brylie commented Oct 12, 2021

Our project consists of three sub-modules:

  • fonts
  • vocabulary
  • vue-vocabulary

Each of the submodules used to have corresponding tests:

The unit tests were invoked in relevant continuous integration scripts:

Task

  • restore all testing code in a tests/ directory in the root of this project
    • tests/vue-vocabulary
  • ensure we have script(s) defined in package.json to invoke the test suites
    • test:vue-vocabulary
  • update CI test runners to invoke restored tests
    • ci-vue.yml (rename to ci-vue-vocabulary.yml)
  • remove fonts tests, since sass-jest is no longer maintained
    • delete vocabulary/.github/workflows/ci-fonts.yml
    • delete vocabulary/.github/workflows/ci-vocabulary.yml
  • delete all unused scripts and code after refactoring tests
@brylie brylie added 🟧 priority: high Stalls work on the project or its dependents 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix 💻 aspect: code Concerns the software code in the repository labels Oct 12, 2021
@brylie brylie added Hacktoberfest Ideal for Hacktoberfest participation hacktoberfest-approved Tasks and pull requests that are approved for Hacktoberfest. help wanted Open to participation from the community internship In the scope of the internship ✨ goal: improvement Improvement to an existing feature 🤖 aspect: dx Concerns developers' experience with the codebase labels Oct 12, 2021
@brylie brylie added this to the v2021.12 - Good housekeeping milestone Oct 12, 2021
@MuluhGodson
Copy link
Contributor

MuluhGodson commented Oct 12, 2021

"scripts": {
    "lint": "eslint src/*.js src/**/*.js tests/**/*.js",
    "test:unit": "jest -c tests/unit/jest.config.js",
    "test:snapshot": "jest -c tests/snapshot/jest.config.js",
    "build": "webpack --mode production",
    "watch": "webpack --mode production --watch --progress",
    "storybook": "start-storybook --ci -s ./src/assets -p 8080 --quiet",
    "build:documentation": "npm run build && build-storybook -s ./src/assets -o ./docs"
  },

This code snippet above is from the package.json file that had the scripts to run the test.
But if you notice, the test is run using a package configuration that is no longer used. jest

https://github.com/creativecommons/vocabulary/blob/5e7f4331d62267a4332da2ca484d29b0575e6007/packages/fonts/package.json

@MuluhGodson
Copy link
Contributor

@brylie I think the last time the former deployment scripts were being used was when this other PR was made:
https://github.com/creativecommons/vocabulary/pull/906

@MuluhGodson
Copy link
Contributor

@brylie I set up all these test independently on my local environment and discovered these test were removed because the package used for test is no longer maintained. There were a lot of bugs especially related to incompatibilities. I checked the repository for the test package used and also noticed an issue was raised there but has not been resolved. I think the package owner will not be pursuing it any longer.

@MuluhGodson
Copy link
Contributor

so the most appropriate way forward will be to write new test or find a similar but current testing package.

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

Alright, we should remove the CI step for now then. Let's repurpose this task to disable the CI script.

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

Which package is no longer maintained? There seem to be at least a couple of test frameworks used in the files above, Vue tests, SCSS tests, and perhaps vanilla JS tests (via Jest).

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

Jest seems to be alive and well

https://jestjs.io/

@MuluhGodson
Copy link
Contributor

Jest is the package that I think has the problem. These packages were provided by vue-cli-service but I think VueJS is now on v3 and that should explain

@MuluhGodson
Copy link
Contributor

Yeah Jest is fine, but the test used a package known as sass-true which lets the sass files be tested via jest

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

OK, shall we deprecate the sass-true tests and keep the other Vue / JS tests then? I'd like to preserve some of the tests if possible.

@MuluhGodson
Copy link
Contributor

It's this sass-true package that makes testing with jest and the sass files buggy now
oddbird/true#154

@MuluhGodson
Copy link
Contributor

Yes I think we can keep the Vue/JS test alive.

@MuluhGodson
Copy link
Contributor

So this issue is still very much valid

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

OK, great! I've updated the task checklist in the description to include "remove fonts tests" while restoring the other tests.

@brylie brylie removed the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Oct 13, 2021
@MuluhGodson
Copy link
Contributor

@brylie while going through the files I noticed the test for fonts and vocabulary was the same. So just the Vue-Vocabulary test is safe as of now.

So I want to request taking this issue to see how I can be able to rewrite some new test for the different packages.

The PR that may be as a result of this may also handle #962

@brylie
Copy link
Contributor Author

brylie commented Oct 13, 2021

@MuluhGodson, I've assigned you to the task. Thanks!

@brylie brylie removed the ✨ goal: improvement Improvement to an existing feature label Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💻 aspect: code Concerns the software code in the repository 🤖 aspect: dx Concerns developers' experience with the codebase 🛠 goal: fix Bug fix Hacktoberfest Ideal for Hacktoberfest participation hacktoberfest-approved Tasks and pull requests that are approved for Hacktoberfest. help wanted Open to participation from the community internship In the scope of the internship 🟧 priority: high Stalls work on the project or its dependents
Development

Successfully merging a pull request may close this issue.

2 participants