Skip to content
This repository was archived by the owner on Dec 10, 2023. It is now read-only.

Commit 7510449

Browse files
committed
release 21.3
1 parent aab209b commit 7510449

23 files changed

+613
-192
lines changed

Diff for: .github/workflows/dockerimage.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ jobs:
1717
docker run -d -p 8081:8081 -p 8082:8082 -p 8083:8083 --name=extensive-server extensiveautomation-server
1818
- name: Test the server
1919
run: |
20+
# install web plugin
21+
ea="extensiveautomation"
22+
es="extensive-server"
23+
docker exec ${es} wget https://github.com/${ea}/${ea}-plugin-web/archive/master.zip
24+
docker exec ${es} unzip master.zip
25+
docker exec ${es} cp -rf ${ea}-plugin-web-master/src/ea/sutadapters/WEB/ ea/sutadapters/
26+
docker exec ${es} ls ea/sutadapters/
27+
docker exec ${es} python ${ea}.py --install_adapter WEB
2028
# install python dependancies
2129
pip install requests
2230
# start to test the server
23-
python ./tests/test_server.py
31+
python -u ./tests/test_server.py

Diff for: .github/workflows/pythonpackage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ jobs:
4848
- name: Test the server
4949
run: |
5050
# start to test the server
51-
python ./tests/test_server.py
51+
python -u ./tests/test_server.py

Diff for: HISTORY

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
21.2.0
2+
Date: 20/09/2019
3+
What's new
4+
1. (medium): REST API - new method to get listing of all running and waiting tasks
5+
2. (minor): Task manager - test id now defined in a task object
6+
3. (medium): Tasks manager - tasks (running, history and waiting) are now cached in memory
7+
4. (minor): Minor changes in swagger files
8+
5. (medium): REST API - new ressource to remove task from cache
9+
6. (medium): REST API - new function to schedule a task
10+
Issues Fixed
11+
1. (medium): fix to support properly ldap authentication for users
12+
2. (minor): REST API - fix path in test and public repositories to get listing files
13+
3. (medium): fix some bugs and typo error reported by flake
14+
4. (medium): REST API - check syntax for adapter integrated as before
15+
5. (medium): unable to open file if already locked by another user, only with python3
16+
6. (minor): REST API - fix function to follow a test result
17+
118
21.1.0
219
Date: 25/08/2019
320
What's new

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The server can run on both Python 2 and Python 3, and also run on Linux and Wind
4545

4646
extensiveautomation --start
4747

48-
3. Finally, check if the [server is running fine](#testing-is-server-running).
48+
3. Finally, check if the [server is running fine](#testing-if-server-running).
4949

5050
### Docker image
5151

@@ -60,7 +60,7 @@ The server can run on both Python 2 and Python 3, and also run on Linux and Wind
6060

6161
If you want to start the container with persistant tests data, go to [Docker Hub](https://hub.docker.com/r/extensiveautomation/extensiveautomation-server) page.
6262

63-
3. Finally, check if the [server is running fine](#testing-is-server-running).
63+
3. Finally, check if the [server is running fine](#testing-if-server-running).
6464

6565
### Source code
6666

@@ -87,7 +87,7 @@ The server can run on both Python 2 and Python 3, and also run on Linux and Wind
8787
cd src/
8888
python extensiveautomation.py --start
8989
90-
4. Finally, check if the [server is running fine](#testing-is-server-running).
90+
4. Finally, check if the [server is running fine](#testing-if-server-running).
9191

9292
## Testing if server running
9393

Diff for: README_fr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Le serveur peut s'exécuter avec Python 2 et Python 3, ainsi que sur Windows et
4747

4848
3. Enfin vérifier le [bon fonctionnement du serveur](#test-du-serveur).
4949

50-
### docker image
50+
### Docker image
5151

5252
1. Téléchargement de l'image depuis docker hub
5353

Diff for: src/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY . /home/extensive/
1111

1212
RUN true \
1313
&& adduser -D extensive \
14-
&& apk add --update --no-cache g++ make libxslt-dev \
14+
&& apk add --update --no-cache g++ make libxslt-dev curl \
1515
&& pip install --no-cache-dir wrapt pycnic lxml jsonpath_ng \
1616
&& apk del --no-cache g++ make \
1717
&& cd /home/extensive \

Diff for: src/ea/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
21.2.1
1+
21.3.0

Diff for: src/ea/releasenotes.txt

+11-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11

2-
21.2.0
3-
Date: 20/09/2019
2+
21.3.0
3+
Date: 02/10/2019
44
What's new
5-
1. (medium): REST API - new method to get listing of all running and waiting tasks
6-
2. (minor): Task manager - test id now defined in a task object
7-
3. (medium): Tasks manager - tasks (running, history and waiting) are now cached in memory
8-
4. (minor): Minor changes in swagger files
9-
5. (medium): REST API - new ressource to remove task from cache
10-
6. (medium): REST API - new function to schedule a task
5+
1. (medium): REST API - new feature to read test logs line by line (/results/details)
6+
2. (minor): docker image updated, curl command added by default
7+
3. (medium): REST API - new feature to get a listing of all runs
8+
4. (minor): new integration tests for github worflow
9+
5. (medium): info messages added in Send_SSH snippet
10+
6. (medium): info messages added in Send_HTTP_CURL snippet
11+
7. (minor): test framework - duration added in result folder
12+
8. (medium): project access granted to all projects for administrator
1113
Issues Fixed
12-
1. (medium): fix to support properly ldap authentication for users
13-
2. (minor): REST API - fix path in test and public repositories to get listing files
14-
3. (medium): fix some bugs and typo error reported by flake
15-
4. (medium): REST API - check syntax for adapter integrated as before
16-
5. (medium): unable to open file if already locked by another user, only with python3
17-
6. (minor): REST API - fix function to follow a test result
14+
1. (minor): fix bad python3 support (Unicode-objects must be encoded before hashing) on REST API /rest/results/listing/by/id/datetime

Diff for: src/ea/servercontrols/RestServerInterface.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,13 @@ class _WebServices(WSGI):
190190

191191
# tests results storage
192192
('/results/listing/files', RestTesterFunctions.ResultsListingFiles()),
193-
('/results/listing/by/id/datetime',
194-
RestTesterFunctions.ResultsListingIdByDateTime()),
193+
('/results/listing/basic', RestTesterFunctions.ResultsListingBasic()),
194+
('/results/listing/by/id/datetime', RestTesterFunctions.ResultsListingFilter()),
195195
('/results/reset', RestAdminFunctions.ResultsReset()),
196196
('/results/remove/by/id', RestTesterFunctions.ResultsRemoveById()),
197197
('/results/remove/by/date', RestTesterFunctions.ResultsRemoveByDate()),
198198
('/results/follow', RestTesterFunctions.ResultsFollow()),
199+
('/results/details', RestTesterFunctions.ResultsDetails()),
199200
('/results/status', RestTesterFunctions.ResultsStatus()),
200201
('/results/verdict', RestTesterFunctions.ResultsVerdict()),
201202
('/results/report/verdicts', RestTesterFunctions.ResultsReportVerdicts()),

Diff for: src/ea/servercontrols/RestTesterFunctions.py

+186-10
Original file line numberDiff line numberDiff line change
@@ -6747,9 +6747,87 @@ def post(self):
67476747
'project-id': projectId}
67486748

67496749

6750-
class ResultsListingIdByDateTime(HandlerCORS):
6750+
class ResultsListingBasic(HandlerCORS):
67516751
"""
6752-
/rest/results/listing/id/by/datetime
6752+
/rest/results/listing/basic
6753+
"""
6754+
@_to_yaml
6755+
def post(self):
6756+
"""
6757+
tags:
6758+
- results
6759+
summary: Get the listing id of all tests results.
6760+
description: ''
6761+
operationId: resultsListingIdByDatetime
6762+
consumes:
6763+
- application/json
6764+
produces:
6765+
- application/json
6766+
parameters:
6767+
- name: Cookie
6768+
in: header
6769+
description: session_id=NjQyOTVmOWNlMDgyNGQ2MjlkNzAzNDdjNTQ3ODU5MmU5M
6770+
required: true
6771+
type: string
6772+
- name: body
6773+
in: body
6774+
required: true
6775+
schema:
6776+
required: [ project-id ]
6777+
properties:
6778+
project-id:
6779+
type: integer
6780+
responses:
6781+
'200':
6782+
description: all tests results with id
6783+
schema :
6784+
properties:
6785+
cmd:
6786+
type: string
6787+
listing:
6788+
type: array
6789+
items:
6790+
type: object
6791+
project-id:
6792+
type: string
6793+
examples:
6794+
application/json: |
6795+
{
6796+
"cmd": "/results/listing/basic",
6797+
"listing": [...]
6798+
}
6799+
'400':
6800+
description: Bad request provided
6801+
'403':
6802+
description: Access denied to this project
6803+
'500':
6804+
description: Server error
6805+
"""
6806+
user_profile = _get_user(request=self.request)
6807+
6808+
try:
6809+
projectId = self.request.data.get("project-id")
6810+
if projectId is None:
6811+
raise EmptyValue("Please specify a project id")
6812+
except EmptyValue as e:
6813+
raise HTTP_400("%s" % e)
6814+
except Exception as e:
6815+
raise HTTP_400("Bad request provided (%s ?)" % e)
6816+
6817+
_check_project_permissions(
6818+
user_login=user_profile['login'],
6819+
project_id=projectId)
6820+
6821+
listing = RepoArchives.instance().getListingBasic(project_id=projectId)
6822+
6823+
return {"cmd": self.request.path,
6824+
"listing": listing,
6825+
'project-id': projectId}
6826+
6827+
6828+
class ResultsListingFilter(HandlerCORS):
6829+
"""
6830+
/rest/results/listing/by/id/datetime
67536831
"""
67546832
@_to_yaml
67556833
def post(self):
@@ -6799,7 +6877,7 @@ def post(self):
67996877
examples:
68006878
application/json: |
68016879
{
6802-
"cmd": "/results/listing/id/by/datetime",
6880+
"cmd": "/results/listing/by/id/datetime",
68036881
"listing": [...]
68046882
}
68056883
'400':
@@ -6827,9 +6905,9 @@ def post(self):
68276905
user_login=user_profile['login'],
68286906
project_id=projectId)
68296907

6830-
listing = RepoArchives.instance().getBasicListing(projectId=projectId,
6831-
dateFilter=dateFilter,
6832-
timeFilter=timeFilter)
6908+
listing = RepoArchives.instance().getListingFilter(projectId=projectId,
6909+
dateFilter=dateFilter,
6910+
timeFilter=timeFilter)
68336911

68346912
return {"cmd": self.request.path,
68356913
"listing": listing,
@@ -7164,7 +7242,8 @@ def post(self):
71647242

71657243
# extract the real test path according the test id
71667244
founded, testPath = RepoArchives.instance().findTrInCache(projectId=projectId,
7167-
testId=testId, returnProject=False)
7245+
testId=testId,
7246+
returnProject=False)
71687247
if founded == Context.instance().CODE_NOT_FOUND:
71697248
raise HTTP_404('test not found')
71707249

@@ -7369,6 +7448,101 @@ def post(self):
73697448
'project-id': projectId}
73707449

73717450

7451+
class ResultsDetails(HandlerCORS):
7452+
"""
7453+
/rest/results/details
7454+
"""
7455+
@_to_yaml
7456+
def post(self):
7457+
"""
7458+
tags:
7459+
- results
7460+
summary: Get details of the test result
7461+
description: ''
7462+
operationId: resultsDetails
7463+
consumes:
7464+
- application/json
7465+
produces:
7466+
- application/json
7467+
parameters:
7468+
- name: Cookie
7469+
in: header
7470+
description: session_id=NjQyOTVmOWNlMDgyNGQ2MjlkNzAzNDdjNTQ3ODU5MmU5M
7471+
required: true
7472+
type: string
7473+
- name: body
7474+
in: body
7475+
required: true
7476+
schema:
7477+
required: [ test-id, project-id ]
7478+
properties:
7479+
test-id:
7480+
type: string
7481+
project-id:
7482+
type: string
7483+
responses:
7484+
'200':
7485+
schema :
7486+
properties:
7487+
cmd:
7488+
type: string
7489+
results:
7490+
type: string
7491+
project-id:
7492+
type: string
7493+
examples:
7494+
application/json: |
7495+
{
7496+
"cmd": "/results/details",
7497+
"project-id": 25
7498+
}
7499+
'400':
7500+
description: Bad request provided
7501+
'403':
7502+
description: Access denied to this project
7503+
'500':
7504+
description: Server error
7505+
"""
7506+
user_profile = _get_user(request=self.request)
7507+
7508+
try:
7509+
testId = self.request.data.get("test-id")
7510+
if testId is None:
7511+
raise HTTP_400("Please specify a list of test id")
7512+
7513+
projectId = self.request.data.get("project-id")
7514+
if projectId is None:
7515+
raise EmptyValue("Please specify a project id")
7516+
7517+
_log_index = self.request.data.get("log-index")
7518+
if _log_index is None:
7519+
_log_index = 0
7520+
7521+
except EmptyValue as e:
7522+
raise HTTP_400("%s" % e)
7523+
except Exception as e:
7524+
raise HTTP_400("Bad request provided (%s ?)" % e)
7525+
7526+
_check_project_permissions(user_login=user_profile['login'],
7527+
project_id=projectId)
7528+
7529+
founded, testPath = RepoArchives.instance().findTrInCache(projectId=projectId,
7530+
testId=testId)
7531+
if founded == Context.instance().CODE_NOT_FOUND:
7532+
raise HTTP_404('Test result not found')
7533+
7534+
state = RepoArchives.instance().getTrState(trPath=testPath)
7535+
verdict = RepoArchives.instance().getTrEndResult(trPath=testPath)
7536+
logs, logs_index = RepoArchives.instance().getTrLogs(trPath=testPath,
7537+
log_index=_log_index)
7538+
return {"cmd": self.request.path,
7539+
'test-id': testId,
7540+
'test-status': state,
7541+
'test-verdict': verdict,
7542+
'test-logs': logs,
7543+
'test-logs-index': logs_index}
7544+
7545+
73727546
class ResultsFollow(HandlerCORS):
73737547
"""
73747548
/rest/results/follow
@@ -7543,7 +7717,6 @@ def post(self):
75437717
projectId = self.request.data.get("project-id")
75447718
if projectId is None:
75457719
raise EmptyValue("Please specify a project id")
7546-
75477720
except EmptyValue as e:
75487721
raise HTTP_400("%s" % e)
75497722
except Exception as e:
@@ -7560,7 +7733,9 @@ def post(self):
75607733

75617734
state = RepoArchives.instance().getTrState(trPath=testPath)
75627735
progress = RepoArchives.instance().getTrProgress(trPath=testPath)
7563-
return {"cmd": self.request.path, 'test-id': testId, 'test-status': state,
7736+
return {"cmd": self.request.path,
7737+
'test-id': testId,
7738+
'test-status': state,
75647739
'test-progress': progress['percent']}
75657740

75667741

@@ -7650,7 +7825,8 @@ def post(self):
76507825

76517826
verdict = RepoArchives.instance().getTrEndResult(trPath=testPath)
76527827
return {"cmd": self.request.path,
7653-
'test-id': testId, 'test-verdict': verdict}
7828+
'test-id': testId,
7829+
'test-verdict': verdict}
76547830

76557831

76567832
class ResultsReportReviews(HandlerCORS):

0 commit comments

Comments
 (0)