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

Programming Exercise: Changing the short name while importing breaks tests #7188

Open
terlan98 opened this issue Sep 13, 2023 · 4 comments
Open

Comments

@terlan98
Copy link
Contributor

Describe the bug

When importing a programming exercise from a file, if the user changes the short name of the exercise, it somehow breaks the test.json file in the test repository. This causes issues with the solution and student builds (some test cases don't work, and the result can't be 100%)

To Reproduce

  1. Download a programming exercise by going to the exercise details page
  2. Import the exercise into another course
  3. When importing, change the short name
  4. The solution build won't get 100% and you'll see a warning (see screenshots)

Expected behavior

The solution build gets a 100% score.

Screenshots

Screenshot 2023-09-13 at 10 14 43

Screenshot 2023-09-12 at 14 01 56

Which version of Artemis are you seeing the problem on?

6.4.3

What browsers are you seeing the problem on?

Chrome

Additional context

Discovered while testing #7178

Relevant log output

No response

@JohannesStoehr
Copy link
Contributor

I was not able to reproduce this issue. Can you make sure that the test.json is present in the original exercise, that the test.json is present in the exported exercise and that the file is no longer present in the imported exercise?

@tobias-lippert
Copy link
Contributor

tobias-lippert commented Sep 14, 2023

@JohannesStoehr For context, I think @terlan98 refers to imports from file in case this wasn't clear.

@terlan98
Copy link
Contributor Author

I tried to reproduce it again to provide you with an example json file but now it's giving me an Internal server error on the staging server when I try to import from file 🤷‍♂️

detail: "Error while giving project permissions"
message: "error.http.500"
path: "/api/courses/4319/programming-exercises/import-from-file"
status: 500
title: "Internal Server Error"
type: "https://www.jhipster.tech/problem/problem-with-message"

@upsj
Copy link

upsj commented Jun 26, 2024

I likely just ran into the same issue, where my original project had the shortname test, the new project had the shortname polymorphismtemplates, and as far as I can tell, every single instance of test was replaced by polymorphismtemplates.

Here a partial diff between the two directories

7,12c7,12
< enable_polymorphismtemplatesing()
< # Add polymorphismtemplates for task 1
< add_executable(ast-polymorphic-polymorphismtemplates ast-polymorphic-polymorphismtemplates.cpp)
< target_link_libraries(ast-polymorphic-polymorphismtemplates Catch2::Catch2WithMain)
< target_include_directories(ast-polymorphic-polymorphismtemplates PRIVATE "${CMAKE_SOURCE_DIR}/../assignment")
< add_polymorphismtemplates(NAME ast-polymorphic COMMAND ast-polymorphic-polymorphismtemplates)
---
> enable_testing()
> # Add test for task 1
> add_executable(ast-polymorphic-test ast-polymorphic-test.cpp)
> target_link_libraries(ast-polymorphic-test Catch2::Catch2WithMain)
> target_include_directories(ast-polymorphic-test PRIVATE "${CMAKE_SOURCE_DIR}/../assignment")
> add_test(NAME ast-polymorphic COMMAND ast-polymorphic-test)
1,4c1,4
< from polymorphismtemplatess.TestCompile import TestCompile
< from polymorphismtemplatess.TestConfigure import TestConfigure
< from polymorphismtemplatess.TestCatch2 import TestCatch2
< from polymorphismtemplatesUtils.Tester import Tester
---
> from tests.TestCompile import TestCompile
> from tests.TestConfigure import TestConfigure
> from tests.TestCatch2 import TestCatch2
> from testUtils.Tester import Tester

This breaks all of my code and is very surprising, so I would be very interested in seeing this issue fixed, or if somebody can point the way, fix it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants