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

Tests for Push application (Lyx,SublimeText,Texmaker,TeXstudio,Vim,WinEdt,TexShop) #10941

Closed
lachiri-ilias opened this issue Feb 28, 2024 · 4 comments

Comments

@lachiri-ilias
Copy link
Contributor

Me and my group (@Blezie, @JohannBiorck @vladdobre @Kr1st1an-F) are currently working on the Issue (#3191 TeXworks). We are currently writing tests for this issue.

We have noticed that all the push method (Lyx, SublimeText, Texmaker, TeXstudio, Vim, WinEdt, TexShop) doesn't contain test and they are very similar. So we wonder if we can contribute to create these tests ?

@Siedlerchr
Copy link
Member

I see, but it's not straightforward to have tests as these interact with external programs on the system and require the editors to be installed on the system.

However, the only thing I would try is to check if the generated command is correctly generated, e.g. if the citation string is correctly generated with prefix + key + suffix

  1. Test pushing entries to the real application and verify that the cite key is correctly inserted
  2. Now you can try to write an automatic test, e.g. verifying the output of getCommandLine to check if it's correctly escaped with all quotes etc

And I just see that PushToLyx for example is missing the prefix and suffix

@koppor
Copy link
Member

koppor commented Feb 28, 2024

Adding tests is kind of "integration test". An X server needs to be started. We do that for

run: xvfb-run --auto-servernum ./gradlew guiTest
.

The test needs to do following:

  1. Install tool X
  2. Open "example.tex" in tool X
  3. Set JabRef to push to tool X
  4. Instruct tool X to save the file
  5. Check "example.tex" for differences.

"example.tex" can be an empty file at step 2.

Steps 2 and 4 can be very difficult from a command line. I expect 10 to 20 hours per tool to find out how to automate.

Thus, I agree with the comment at #10941 (comment) so that the generated string is correct.

Blezie added a commit to vladdobre/jabref that referenced this issue Feb 29, 2024
Co-Authored-By: JohannBiorck <85625348+johannbiorck@users.noreply.github.com>
Co-Authored-By: LACHIRI ILIAS <67273129+lachiri-ilias@users.noreply.github.com>
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 1, 2024
Co-Authored-By: JohannBiorck <85625348+johannbiorck@users.noreply.github.com>
Co-Authored-By: LACHIRI ILIAS <67273129+lachiri-ilias@users.noreply.github.com>
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 4, 2024
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 4, 2024
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 4, 2024
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 4, 2024
Blezie added a commit to vladdobre/jabref that referenced this issue Mar 4, 2024
@AdamWysokinski
Copy link
Contributor

AdamWysokinski commented Apr 4, 2024

The test needs to do following:

1. Install tool X

2. Open "example.tex" in tool X

3. Set JabRef to push to tool X

4. Instruct tool X to save the file

5. Check "example.tex" for differences.

"example.tex" can be an empty file at step 2.

Steps 2 and 4 can be very difficult from a command line. I expect 10 to 20 hours per tool to find out how to automate.

Thus, I agree with the comment at #10941 (comment) so that the generated string is correct.

If this would be of any use, in SublimeText commands may be run from CLI:

subl -b --command open "example.tex"
subl -b --command save

The -b switch makes it to run in the background.

@koppor
Copy link
Member

koppor commented Apr 7, 2024

I close this issue as this is neither a user-facing issue nor something reported by the maintainers of JabRef.

Nevertheless, thank you for choosing JabRef.

@koppor koppor closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
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

No branches or pull requests

4 participants