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

Run Cypress under GitHub Actions & install Node dependencies in Docker image #1518

Merged
merged 3 commits into from
Sep 20, 2023

Conversation

osma
Copy link
Member

@osma osma commented Sep 20, 2023

Reasons for creating this PR

We want to have Cypress tests for the new frontend, and those tests should be automated as much as possible. PR #1509 changed the Cypress test to run against a standardized, dockerized Skosmos and Fuseki environment. This PR takes it a step further by also running the Cypress tests under GitHub Actions as a separate job.

In addition, while making this PR, I noticed that the Node dependencies of the frontend (e.g. Bootstrap and Vue.js) were not installed by the Dockerfile (they would only be included if they had been installed in the surrounding Skosmos codebase, and in that case often the development dependencies would be included as well). So I adjusted the Dockerfile to include a separate npm-installer stage that only installs those Node dependencies, then they are copied over to the next stage which is the Skosmos runtime image.

Link to relevant issue(s), if any

  • Closes Add e2e tests #1189
  • Supersedes PR Run cypress #1479 by @kinow (this PR builds on the previously merged ones which didn't yet exist when 1479 was opened; I used that PR for inspiration, but wasn't able to copy the implementation)

Description of the changes in this PR

  • add GitHub Actions job that executes Cypress tests
  • adjust Dockerfile.ubuntu (and .dockerignore) to make sure that the Node.js dependencies for production (Bootstrap and Vue) are included in the image, but not the development dependencies

Known problems or uncertainties in this PR

n/a

Checklist

  • phpUnit tests pass locally with my changes
  • I have added tests that show that the new code works, or tests are not relevant for this PR (e.g. only HTML/CSS changes)
  • The PR doesn't reduce accessibility of the front-end code (e.g. tab focus, scaling to different resolutions, use of .sr-only class, color contrast)
  • The PR doesn't introduce unintended code changes (e.g. empty lines or useless reindentation)

@osma osma added this to the 3.0 milestone Sep 20, 2023
@osma osma self-assigned this Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (4af39d3) 70.51% compared to head (23fdb64) 70.51%.
Report is 3 commits behind head on skosmos-3.

Additional details and impacted files
@@             Coverage Diff              @@
##             skosmos-3    #1518   +/-   ##
============================================
  Coverage        70.51%   70.51%           
  Complexity        1642     1642           
============================================
  Files               32       32           
  Lines             4314     4314           
============================================
  Hits              3042     3042           
  Misses            1272     1272           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@osma osma requested a review from miguelvaara September 20, 2023 07:04
Copy link
Contributor

@miguelvaara miguelvaara left a comment

Choose a reason for hiding this comment

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

I do not see any harm in adding --ignore-scripts. Let's proceed with it according to your view. Otherwise, the tests are working smoothly, everything is okay and looks good! 👍

dockerfiles/Dockerfile.ubuntu Outdated Show resolved Hide resolved
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@osma osma mentioned this pull request Sep 20, 2023
4 tasks
@osma
Copy link
Member Author

osma commented Sep 20, 2023

CI tests are still passing, so I will merge this now.

@osma osma merged commit db04611 into skosmos-3 Sep 20, 2023
10 of 12 checks passed
@osma osma deleted the issue1189-cypress-under-github-actions branch September 20, 2023 10:42
@osma osma mentioned this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done (verified in test.dev.finto.fi, set Milestone 3.0 for both issue & PR)
Development

Successfully merging this pull request may close these issues.

2 participants