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

601 creating instance tests #616

Merged
merged 28 commits into from
May 27, 2024
Merged

601 creating instance tests #616

merged 28 commits into from
May 27, 2024

Conversation

Antonyjin
Copy link
Member

Feature: Added tests to check if Firecracker instance runs with network interface.
The tests bypass systemd manager

nesitor and others added 4 commits May 3, 2024 15:14
Adding a test that start and stop a simple fake instance
Creating an instance locally using fake_data and checks if the execution start
and stop properly.
Doing the same checks with the VM created.
@Antonyjin Antonyjin requested review from hoh and nesitor May 7, 2024 13:31
@Antonyjin Antonyjin self-assigned this May 7, 2024
@Antonyjin Antonyjin linked an issue May 7, 2024 that may be closed by this pull request
1 task
ajin and others added 22 commits May 7, 2024 15:35
Black check was failing

Solution: Use black to format bad files
isort check was failing

Solution: Use isort to format bad files
* Feature: Added automatic tests to check if QEmu runs.

* Fix: Added code quality fixes.

* Fix: Changed runtime generation script name.

* Fix: Solve conflicts with main branch.
ruff check was failing

Solution: Use ruff to format bad files
This deploys the main branch automatically on the staging servers for system testing.
Problem: Many crawlers called URLs that do not exist on CRNs.

The current implementation raises an error when the hash of the VM cannot be found, which fills the logs on Sentry.

Solution: Return an HTTP Not Found status instead.
mypy was failing because I tried to stop an execution but did not
checked if there was an existing execution

Solution: Check first if there an execution and then stop and shutdown
Adding a test that start and stop a simple fake instance
Creating an instance locally using fake_data and checks if the execution start
and stop properly.
Doing the same checks with the VM created.
Black check was failing

Solution: Use black to format bad files
isort check was failing

Solution: Use isort to format bad files
ruff check was failing

Solution: Use ruff to format bad files
mypy was failing because I tried to stop an execution but did not
checked if there was an existing execution

Solution: Check first if there an execution and then stop and shutdown
Instance test try to chmod a user named jailman that
did not exist

Solution: Creating the user jailman
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 92.95154% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 56.15%. Comparing base (ffa2322) to head (2fc7d92).
Report is 8 commits behind head on main.

Files Patch % Lines
src/aleph/vm/controllers/__main__.py 54.54% 5 Missing ⚠️
src/aleph/vm/orchestrator/views/__init__.py 55.55% 4 Missing ⚠️
tests/supervisor/test_instance.py 95.89% 2 Missing and 1 partial ⚠️
tests/supervisor/test_qemu_instance.py 96.96% 2 Missing and 1 partial ⚠️
src/aleph/vm/models.py 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #616       +/-   ##
===========================================
+ Coverage   44.82%   56.15%   +11.32%     
===========================================
  Files          55       59        +4     
  Lines        5033     5250      +217     
  Branches      589      597        +8     
===========================================
+ Hits         2256     2948      +692     
+ Misses       2654     2172      -482     
- Partials      123      130        +7     

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

.github/workflows/test-using-pytest.yml Outdated Show resolved Hide resolved
src/aleph/vm/models.py Show resolved Hide resolved
This job to create a new user do not need hes own job, we could
just insert it in a previous job
@nesitor nesitor self-requested a review May 27, 2024 12:24
@nesitor nesitor merged commit cc3f292 into main May 27, 2024
23 checks passed
@nesitor nesitor deleted the 601-creating-instance-tests branch May 27, 2024 12:25
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.

Creating instance tests
3 participants