100 Commits

Author SHA1 Message Date
7cc4fb00c6 RfCs: Allow filtering for any states
We want to differentiate between those RfCs explicitly marked as solved, those potentially solved since the author reached the maximum score, and those being unsolved where the author has not yet reached the full score yet.
2024-04-24 12:18:47 +02:00
988aefdbf9 Add tests for Exercise#needs_more_feedback? 2023-11-23 14:42:10 +01:00
411eb0b165 Specs: Use Runner factory and provide strategy class 2023-10-31 12:35:24 +01:00
8fc5123bae Exclusively lock Runners during code executions
Previously, the same runner could be used multiple times with different submissions simultaneously. This, however, yielded errors, for example when one submission time oud (causing the running to be deleted) while another submission was still executed.

Admin actions, such as the shell, can be still executed regardless of any other code execution.

Fixes CODEOCEAN-HG
Fixes openHPI/poseidon#423
2023-10-31 12:35:24 +01:00
99bd46af1a Align project files with CodeHarbor
Since both projects are developed together and by the same team, we also want to have the same code structure and utility methods available in both projects. Therefore, this commit changes many files, but without a functional change.
2023-10-11 00:18:33 +02:00
e767cff309 Fix flaky tests dependent on exercise.reload for files 2023-09-16 16:57:59 +02:00
a1941336d9 Fix Runner access for programming groups
* We also rename the corresponding columns in the Runner model, so that for polymorphic association gets clear.
2023-08-24 19:32:06 +02:00
be4f2b790d Add user to testrun
* We want to identify a user that has triggered a testrun. Previously (in regular operation), only submission author who were regular users were able to start a testrun. Now, we want to prepare a future where submission authors are programming groups. Still, a testrun is triggered by an individual user and not a group.
* Further, this commit fixes some missing foreign key constrains.
2023-08-24 19:32:06 +02:00
e2baa2ee55 Send score for all members of a programming group 2023-08-24 19:32:06 +02:00
0234414bae Rename user to contributor in submission 2023-08-24 19:32:06 +02:00
8f446c04a9 Fix Rubocop offenses 2023-07-31 08:59:00 +02:00
ccbf41005b Always clear runner strategy after each test case
Otherwise, we get different test results depending on the test order.
2023-06-23 22:20:04 +02:00
637f872f34 add file_extension validation for file_type 2023-02-09 18:42:24 +01:00
afe7428a6f Ensure upload directory exists for symlink test 2023-01-16 11:16:03 +01:00
574e99eddd Fix rubocop offenses - Requires Ruby 3.1+ 2022-11-25 11:10:06 +01:00
c75f52f2c8 Fix Rubocop offenses 2022-10-24 12:28:50 +02:00
eb188dcd71 Add privilegedExecution flag to database and Poseidon Strategy 2022-09-24 22:32:41 +02:00
cb1b163b30 Always create a default study group for new consumers 2022-09-22 19:24:26 +02:00
521626275f Use create for all users in specs where necessary 2022-09-22 19:24:26 +02:00
9c9f45ff77 Redefine user roles with their role in a study group 2022-09-22 19:24:26 +02:00
813c3f50af Touch file location before setting a symlink in specs 2022-09-04 19:15:15 +02:00
9050f02b7a Add additional test case for new CodeOcean::File#read method 2022-09-02 17:52:24 +02:00
e0c2c7b806 Hide score button if exercise has no tests
We check for all teacher-defined assessments (linter and unit tests) to determine whether scoring should be possible
2022-08-22 17:51:57 +02:00
d762f976a8 Add new CodeOcean::File#read method
* With a new method, we can simplify our code to handle differences between file.content and file.native_file.read
2022-08-19 22:42:55 +02:00
6803efc023 Fix order-dependent specs
The submission spec is removed as it was useless since 66c1b992
2022-08-12 11:39:42 +02:00
ea02dff0e5 Extend storage of Testrun Messages and truncate long output 2022-04-29 22:44:34 +02:00
d9f40531fb Fix Rubocop offenses 2022-04-20 18:26:53 +02:00
ea85519163 Update bundle (with newest rubocop version) and fix offenses 2022-01-04 09:42:37 +01:00
fb92d382ac Skip verification of Docker image if pool size is empty 2021-11-09 17:49:51 +01:00
c1ac401a49 Add retries to working_docker_image?
* Also synchronize images during save
2021-11-04 20:09:19 +01:00
ecf470bddd Refactor sync_environment methods
* Add delete_environment method
* Change return value to allow raising an exception
2021-11-04 20:06:40 +01:00
1609bd2e0e Change default of raise_exception for execute_command 2021-11-01 17:13:11 +01:00
01ec9343cf Remove usage of DockerClient 2021-11-01 17:13:10 +01:00
0db6f20933 Move MemoryLimit to Execution Environment 2021-11-01 17:13:06 +01:00
d87e23b9a3 Add execute_command method to runner.rb
* This is now used by the score and test runs
* This also re-enables the interactive shell for execution environments
2021-11-01 17:13:05 +01:00
c676785d55 Fix order-dependent runner_spec.rb 2021-11-01 17:13:02 +01:00
06ef4430f5 Change exposed_ports to array 2021-11-01 17:13:02 +01:00
30603cb7ab Generalize method and constant names for runner management 2021-11-01 17:12:53 +01:00
9e2cff7558 Attach connection errors to socket
Raising the errors would crash the current thread. As this thread
contains the Eventmachine, that would influence other connections
as well. Attaching the errors to the connection and reading them
after the connection was closed ensures that the thread stays
alive while handling the errors in the main thread of the current
request.
2021-11-01 17:12:53 +01:00
c8e1a0bbcb Fix tests for Runner#attach_to_execution
These tests were blocking because of the newly introduced
EventLoop. The messages sent to the EventLoop are now mocked
and the EventLoop isn't blocking anymore in the tests.
2021-11-01 17:12:53 +01:00
2dff81a510 Attach duration information to the exception object 2021-11-01 17:12:52 +01:00
db2d1e3164 Add tests for DockerContainerPool strategy 2021-11-01 17:12:51 +01:00
704407b9fc Add strategy for DockerContainerPool
In order to provide an alternative to Poseidon, a strategy for the
DockerContainerPool is added that is used by the runner model.

Co-authored-by: Sebastian Serth <Sebastian.Serth@hpi.de>
2021-11-01 17:12:51 +01:00
1d3f0d7ad8 Handle Faraday errors 2021-11-01 17:12:50 +01:00
b48b45de9f Refactor error classes
All runner errors are now in a single file. The not found error
has been splitted into an error for runner not found and for
environment not found.
2021-11-01 17:12:50 +01:00
413f9b2705 Improve error resilience and handling
Timeouts are now handled correctly and the Runner automatically
creates the execution environment if it could not be found in
Poseidon. The runner is deleted locally if Poseidon returns
a bad request error.
2021-11-01 17:12:50 +01:00
b6bc578aea Move submission scoring from controller concern to submission model
Localization and markdown formatting is now done in a controller
spec in order to bring this logic away from the data and towards
the view.
2021-11-01 17:12:50 +01:00
d0d1b1bffd Introduce strategy for runner behavior
The runner model is only a class responsible for storing information
now. Based on the configuration it picks a strategy for the runner
management. The Poseidon strategy is already implemented and tested.
The Docker strategy will follow.
2021-11-01 17:12:49 +01:00
0978a3be83 Add tests for the different runner errors 2021-11-01 17:12:48 +01:00
d22d24df4d Add tests for execution environment copy to Poseidon 2021-11-01 17:12:48 +01:00