System test#34
Conversation
|
@duggelz I couldn't see your comment on the UI, the |
|
|
||
|
|
||
| @nox.session | ||
| @nox.parametrize('python_version', ['2.7', '3.5']) |
| name: Install packages | ||
| command: | | ||
| apt-get update | ||
| apt-get install netcat-openbsd |
There was a problem hiding this comment.
See comment above.
| '-s', | ||
| 'tests/system/', | ||
| *session.posargs, | ||
| success_codes=range(0, 100) |
There was a problem hiding this comment.
What does this do? It seems like it ignores all error codes in the [1,99] range? Can we reduce this list, and document the expected error codes?
There was a problem hiding this comment.
Removed. Will add documentation after several observations of the system tests failure(if any).
| -in credentials.json.enc \ | ||
| -out "$GOOGLE_APPLICATION_CREDENTIALS" | ||
| else | ||
| echo "No credentials. System tests will not run." |
|
|
||
| app = flask.Flask(__name__) | ||
|
|
||
| # Enbale tracing, send traces to Stackdriver Trace |
| 'http://127.0.0.1:8080', | ||
| headers=self.headers_trace) | ||
|
|
||
| time.sleep(5) |
There was a problem hiding this comment.
We'll want to go back later and change the hardcoded sleep times to use retry or similar, but this is ok for now.
There was a problem hiding this comment.
Yes, will use retry in later PR.
| self.assertEqual( | ||
| trace.get('spans')[0].get('parentSpanId'), | ||
| str(self.span_id)) | ||
|
|
There was a problem hiding this comment.
Can you check the span attributes also?
| ENV PATH /env/bin:$PATH | ||
| ADD . /app/ | ||
| RUN pip install -r requirements.txt | ||
| EXPOSE 8000 |
There was a problem hiding this comment.
What's running on port 8000, and what's running on port 8080? Is there an inconsistency with some of the other code below?
There was a problem hiding this comment.
Thanks for pointing out! Actually I'm going to remove this dockerfile since it's not used in the system test, just for running locally.
| return process | ||
|
|
||
|
|
||
| class TestFlaskTrace(unittest.TestCase): |
There was a problem hiding this comment.
If we could separate the "test harness" from the "start flask application", we could reduce some of the duplicated code between the django and flask tests.
There was a problem hiding this comment.
Yes, will fix in separate PR.
|
|
||
| tracer.end_trace() | ||
|
|
||
| file = open(file_reporter.DEFAULT_FILENAME, 'r') |
There was a problem hiding this comment.
If we later make tracing asynchronous (which we should), we'll have to remember to add some kind of wait or flush here, between closing the last span and opening the reporter file.
There was a problem hiding this comment.
Yes, will do that.
No description provided.