arXiv / arxiv-submission-ui

User interface of NG submit system.
MIT License
2 stars 6 forks source link

Adds basic integration test #188

Closed bdc34 closed 4 years ago

bdc34 commented 4 years ago

This PR adds a basic integration test at submit.integration.integration_test

It does not yet automate the running of that test in a CI system.

To run the integration test do:

cd arxiv-submission-ui
./integrationtest.sh
DavidLFielding commented 4 years ago

I'm currently looking over the code to better understand how these tests run.

The ./integrationtest.sh fails when I run it with no indication of such outside the logs. A single connection error appears in the docker-compose log.

Upon launching the ./integrationtest.sh script various Docker images are built. Once the submission UI is brought up the terminal is flooded with docker-compose log message. Once the error flies by the docker-compose log messages continue until I CTR-C out of the test script.

Note that the test script never appears to take control of (shut down) the Submission UI after the error occurs. I suspect the test does not recognize the failure.

I tried to run this a second time and it fails.

mhl10 commented 4 years ago

After a few minutes of running the script, I eventually get the following error:

arxiv-submission-ui       | application 25/Aug/2020:13:12:38 +0000 - submit.routes.ui.flow_control - None - [arxiv:null] - DEBUG: "method: GET action: None, code: 200, controller action: stage_reshow, last_stage: False"
arxiv-submission-ui       | application 25/Aug/2020:13:12:38 +0000 - submit.routes.ui.flow_control - None - [arxiv:null] - DEBUG: "flow decisions is SHOW_CONTROLLER_RESULT"
arxiv-submission-ui       | 172.18.0.18 172.18.0.18 - -|- [25/Aug/2020:13:12:37 -0400] [python-requests/2.21.0] "GET /1/file_process HTTP/1.1" 200 21744 118412 118117
submission-integration-test | F
submission-integration-test | ======================================================================
submission-integration-test | FAIL: test_submission_system_basic (__main__.TestSubmissionIntegration)
submission-integration-test | Create, upload files, process TeX and submit a submission.
submission-integration-test | ----------------------------------------------------------------------
submission-integration-test | Traceback (most recent call last):
submission-integration-test |   File "/opt/arxiv/submit/integration/test_integration.py", line 318, in test_submission_system_basic
submission-integration-test |     page_test()
submission-integration-test |   File "/opt/arxiv/submit/integration/test_integration.py", line 241, in process_page
submission-integration-test |     'Failed to process and get tex compiler summary after {self.process_page_timeout} sec.')
submission-integration-test | AssertionError: False is not true : Failed to process and get tex compiler summary after {self.process_page_timeout} sec.
submission-integration-test |
submission-integration-test | ----------------------------------------------------------------------
submission-integration-test | Ran 1 test in 124.362s
submission-integration-test |
submission-integration-test | FAILED (failures=1)
submission-integration-test exited with code 1

There's likely a problem with my local copy of the compiler in that I haven't set it up properly. I will investigate.

bdc34 commented 4 years ago

The ./integrationtest.sh fails when I run it with no indication of such outside the logs. A single connection error appears in the docker-compose log.

Note that the test script never appears to take control of (shut down) the Submission UI after the error occurs. I suspect the test does not recognize the failure.

Yes, the script will hang. That needs to be fixed when we get to automating this for CI.

bdc34 commented 4 years ago

There's likely a problem with my local copy of the compiler in that I haven't set it up properly. I will investigate.

That seems about right. It is stopping at the TeX process stage after failing the timeout. The timeout is rather long, like 3 minutes.

bdc34 commented 4 years ago

I'm currently looking over the code to better understand how these tests run.

The test is a unittest in submit/integration/test_integration.py

The integrationtest.sh runs the docker-compose.yml combined with the docker-compose-integration.yml.

bdc34 commented 4 years ago

This looks great to me. It ran fine, and gave me a 1 unit test success message. Seems reasonably fast. If the --exit-code-from doesn't work out, maybe the other services could be started first with -d ?

Yes, the --exit-code-from didn't work because there are other services that exit early like the workers. I was thinking of just making them non-exiting because I don't think it would matter. Then I could use --exit-code-from in a normal way.

But -d might be good too. Oh, one thing is that the integration test needs to run inside of the docker-compose so it can run the bootstrap to get an auth JWT.

DavidLFielding commented 4 years ago

Side comment: I fired up the Submission UI using the normal docker-compose mechanism and I'm able to run through the entire submission process all the way through to submitting the paper. This is good news to me as my integration test fails at the selection of the primary category.