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

Package Revisions #3055

Merged
merged 223 commits into from Nov 23, 2018
Merged
Show file tree
Hide file tree
Changes from 219 commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
8ecc600
apiv2 server
lasote Jun 6, 2018
3f0aa16
wip
lasote Jun 7, 2018
c4ccec3
Server v2 almost ready but nothing tested
lasote Jun 8, 2018
fb2bf2c
Most tests passing
lasote Jun 8, 2018
95d6f50
WIP adding binary package revisions
lasote Jun 11, 2018
bcf3d40
revisions in references
lasote Jun 12, 2018
8c42617
Refactor storage, search ok
lasote Jun 12, 2018
666e83c
WIP
lasote Jun 13, 2018
b06e0b9
Failing less
lasote Jun 14, 2018
9e7ce94
Fixed tests
lasote Jun 14, 2018
ac3f916
Clean traceback
lasote Jun 14, 2018
a35049b
Merge remote-tracking branch 'radical/develop' into feature/new_revis…
lasote Jun 14, 2018
4b60b40
Apiv2 tests passing (without revisions activated)
lasote Jun 15, 2018
a76166b
jenkins multiapi
lasote Jun 15, 2018
c529a73
Fixed jenkins
lasote Jun 15, 2018
ba6a144
Unique folders
lasote Jun 15, 2018
873d6f2
Merge develop
lasote Jun 27, 2018
964c886
Git commits as revisions
lasote Jun 27, 2018
825c39b
PEnding server better route
lasote Jun 28, 2018
9b251c8
Merge remote-tracking branch 'radical/master' into feature/new_revisions
lasote Jun 28, 2018
7c143cd
Merge branch 'develop' into feature/new_revisions
lasote Jun 28, 2018
1c6a97f
Fixed routes
lasote Jun 28, 2018
7a2d695
Merged 1.5.1
lasote Jun 28, 2018
d1a7fa3
Merge remote-tracking branch 'radical/develop' into feature/new_revis…
lasote Jul 2, 2018
5ff402d
changes revisions, many pending
lasote Jul 2, 2018
7806417
Merged 1.5.2
lasote Jul 5, 2018
45ba5a7
Pending work, pending issues
lasote Jul 6, 2018
69b0ea9
Fixed some test
lasote Jul 6, 2018
7df37ad
Merge remote-tracking branch 'radical/develop' into feature/new_revis…
lasote Jul 6, 2018
1cea861
AsserRaiseRegex
lasote Jul 6, 2018
4e5735e
AsserRaiseRegex
lasote Jul 6, 2018
ab2be57
Fixed actions
lasote Jul 6, 2018
b33d90d
First revision tests
lasote Jul 7, 2018
a8a589b
Upload also updates local registry
lasote Jul 7, 2018
6864dc6
Review
lasote Jul 9, 2018
54d7215
Revision
lasote Jul 9, 2018
057513a
Info fixed
lasote Jul 9, 2018
76d60a8
Server search for server
lasote Jul 9, 2018
9a3add6
Pending managing references better
lasote Jul 11, 2018
dd21e4d
Some fixes
lasote Jul 12, 2018
d33965a
Merged 1.6
lasote Jul 20, 2018
536f705
Fixed sources tgz
lasote Jul 20, 2018
54761be
Fixed test
lasote Jul 20, 2018
a0917c7
Check earlier the txz
lasote Jul 20, 2018
c0c763f
fixed some tests
lasote Jul 20, 2018
5d46b3f
Mimetype
lasote Jul 20, 2018
d4c3b7f
Remote order
lasote Jul 20, 2018
b875cc2
revisions test
lasote Jul 20, 2018
95bbdfb
Merged develop
lasote Jul 23, 2018
9d69967
Debug mac issues
lasote Jul 23, 2018
96ccb35
Prints debug
lasote Jul 23, 2018
4d342e6
More debug
lasote Jul 23, 2018
163b464
More debug
lasote Jul 23, 2018
acd8587
More debug
lasote Jul 23, 2018
cfc7885
All tests
lasote Jul 23, 2018
a396e28
and more debug
lasote Jul 23, 2018
27adf79
and more debug
lasote Jul 23, 2018
4e54be7
Fixed env
lasote Jul 23, 2018
6d1ce47
Remove prints
lasote Jul 23, 2018
44733f9
All configs
lasote Jul 23, 2018
fb2bb0a
pull image
lasote Jul 23, 2018
f35ba38
Merged develop
lasote Jul 24, 2018
1d3302a
Fixing tests
lasote Jul 24, 2018
4c23d3a
Some more tests
lasote Jul 24, 2018
f765c8c
Fixed rev test
lasote Jul 25, 2018
881bc51
Removed server storage adapter custom
lasote Jul 25, 2018
199b6de
More test, controlled package uploading
lasote Jul 25, 2018
42e32db
More test, controlled package uploading
lasote Jul 25, 2018
edefb21
Fixed tests
lasote Jul 25, 2018
52ece93
Fix skip remote
lasote Jul 25, 2018
a92c255
new revisions
lasote Jul 25, 2018
53aa643
Tagged test not revisions compatible, jenkinsfile progress
lasote Jul 25, 2018
36b0ec4
Fix workspace var
lasote Jul 25, 2018
a68d848
Fix workspace var
lasote Jul 25, 2018
1caa76f
Fix workspace var
lasote Jul 25, 2018
ac051fc
Fix workspace var
lasote Jul 25, 2018
b8d4ef1
Jenkinsfile
lasote Jul 25, 2018
ebb4710
Jenkinsfile
lasote Jul 25, 2018
652da6b
Jenkinsfile
lasote Jul 25, 2018
90cc92d
Jenkinsfile
lasote Jul 25, 2018
d8f03d0
Jenkinsfile
lasote Jul 25, 2018
2bf302e
Jenkinsfile
lasote Jul 25, 2018
76776c1
Jenkinsfile
lasote Jul 25, 2018
de9a2db
Jenkinsfile
lasote Jul 25, 2018
be257b9
Jenkinsfile
lasote Jul 25, 2018
caf5906
Switch complete
lasote Jul 25, 2018
290730d
Switch complete
lasote Jul 25, 2018
26a48c7
Switch complete
lasote Jul 25, 2018
0e5684e
Excluded some test fixed others
lasote Jul 26, 2018
f4c2cac
Fixes
lasote Jul 26, 2018
f6d7737
fix double locking
lasote Jul 26, 2018
6d1aacb
Clear revision in registry when export
lasote Jul 26, 2018
9f5451e
Missing test
lasote Jul 26, 2018
41c0d9d
Merge branch 'feature/new_revisions' of github.com:lasote/conan into …
lasote Jul 26, 2018
d1b6fa4
Try to fix test
lasote Jul 26, 2018
4e33a8b
Try to fix test
lasote Jul 26, 2018
df75023
Try to fix test
lasote Jul 26, 2018
508b6a3
Sleep 1 after upload
lasote Jul 26, 2018
f9b9cdd
Sleep 1 sec
lasote Jul 26, 2018
a30a9ce
New revisions test and fixed rest api tests
lasote Jul 26, 2018
550032b
New tests
lasote Jul 26, 2018
c8a1c86
Revisions search + delete in progress
lasote Jul 27, 2018
aa99033
New tests search + remove
lasote Jul 27, 2018
afe598e
Merge remote-tracking branch 'origin/develop' into feature/new_revisions
lasote Jul 27, 2018
1a796ac
Not delete package, let update if update or keep the bad package
lasote Aug 16, 2018
4f418fe
Revision + merged with develop
lasote Aug 17, 2018
e7dc8aa
Review
lasote Aug 17, 2018
0d984bc
Fixed test, better storage of references and simplified code
lasote Aug 17, 2018
fe4251c
Added server
lasote Aug 20, 2018
88c3856
init
lasote Aug 20, 2018
3b4f08f
server test launcher
lasote Aug 20, 2018
8aad813
Ref model
lasote Aug 20, 2018
52328dd
fixed server launcher
lasote Aug 20, 2018
7a5a77e
Fixed service test
lasote Aug 20, 2018
e68dc5c
Server tests
lasote Aug 20, 2018
33b9144
Review
lasote Aug 21, 2018
5d1413d
Refactor server storages
lasote Aug 22, 2018
53e8c74
Merge remote-tracking branch 'origin/develop' into feature/revisions_…
lasote Aug 22, 2018
699c1b3
Merged with revisions only server and latest develop
lasote Aug 22, 2018
7113022
Fix errors
lasote Aug 22, 2018
5031bc0
Fixed search service return
lasote Aug 22, 2018
cd5f36d
Fixed storage issues with v2 without revisions
lasote Aug 22, 2018
799261f
Fixed ref with v2 without revisions, removed py34
lasote Aug 22, 2018
cdacd15
Merge with develop
lasote Aug 22, 2018
48cff5c
Merged with develop
lasote Aug 29, 2018
569465e
Fix test recipe corrupted
lasote Aug 29, 2018
ccfa347
Failing hard
lasote Aug 29, 2018
5f0ec7f
Merge remote-tracking branch 'origin/develop' into feature/api_v2_client
lasote Aug 30, 2018
0591273
Fixed v2 without revisions
lasote Aug 30, 2018
dd07457
Runner equal
lasote Aug 30, 2018
eed6cdc
typo
lasote Aug 30, 2018
163eb31
typo
lasote Aug 30, 2018
89e276d
Fixing test apiv2
lasote Aug 30, 2018
a99b9f1
Fix test
lasote Aug 30, 2018
91911cd
Merge remote-tracking branch 'origin/develop' into feature/api_v2_client
lasote Sep 13, 2018
d549cf3
Merged with develop
lasote Sep 13, 2018
01cabac
fixed jenkins conf
lasote Sep 13, 2018
769a430
Renamed method
lasote Sep 13, 2018
543995d
Merged apiv2 branch
lasote Sep 14, 2018
86401a5
dead code
lasote Sep 14, 2018
dafc475
Prepared to work easier with revision and speculative metadata for fi…
lasote Sep 14, 2018
24613ad
Merged updated apiv2 branch
lasote Sep 14, 2018
0995b03
Fix flow without revisions in apiv2
lasote Sep 14, 2018
0ec08f2
Fixing managing dict snapshot
lasote Sep 14, 2018
95f2c7b
Removed comment
lasote Sep 14, 2018
c02079f
Merge branch 'feature/api_v2_client' into feature/new_revisions
lasote Sep 14, 2018
e8e77db
Jenkinsfile for revisions
lasote Sep 14, 2018
93f56b2
Merged develop
lasote Sep 14, 2018
c08f962
Replaced urls with a /revisions/ partial endopoint instead of #
lasote Sep 14, 2018
f9c45ae
Jenkinsfile develop
lasote Sep 14, 2018
db099c9
Merged with develop. WIP
lasote Oct 18, 2018
3875feb
WIP
lasote Oct 19, 2018
8d48ec5
Improving tests
lasote Oct 19, 2018
344ba81
Working on the merge with develop
lasote Oct 19, 2018
6fef848
Merge remote-tracking branch 'origin/develop' into feature/new_revisions
lasote Oct 22, 2018
1a4089f
Working to update with binary registry revisions
lasote Oct 22, 2018
d80b914
WIP, almost everything green but wrong
lasote Oct 23, 2018
e90cbc8
Everything broken
lasote Oct 24, 2018
d3d2826
Almost green, pending introduce sequential search in server
lasote Oct 24, 2018
472411b
Server v2 and searching latest pid
lasote Oct 24, 2018
1aa6645
Cleaned test tags and fixed test
lasote Oct 24, 2018
b425038
Fixed last test
lasote Oct 24, 2018
ac02933
refresh
lasote Oct 24, 2018
34371e5
Simpler Jenkins and fixed test
lasote Oct 24, 2018
03eb8ee
Fixed jenkinsfile
lasote Oct 24, 2018
9202a69
Fixed jenkinsfile
lasote Oct 24, 2018
04651e9
Fixed rest api and recovered excluded tags
lasote Oct 24, 2018
65c940a
Full tests and fixed non-revisions test suite
lasote Oct 24, 2018
e258bb5
More simplified jenkins
lasote Oct 24, 2018
9502b50
3 flavors
lasote Oct 24, 2018
5133460
Fixed jenkinsfile
lasote Oct 24, 2018
670d8e4
fixed runner
lasote Oct 24, 2018
c8d4957
Fixed config replace when activating revisions
lasote Oct 24, 2018
15cd5f6
Fixing tests
lasote Oct 25, 2018
e6ad215
Merged with develop
lasote Oct 25, 2018
77d8da2
Improving compatibility with revision deactivated in client
lasote Oct 25, 2018
de2fc2d
Merge remote-tracking branch 'origin/develop' into feature/new_revisions
lasote Oct 25, 2018
98199bd
all passing
lasote Oct 25, 2018
cbc0730
Merge remote-tracking branch 'origin/develop' into feature/new_revisions
lasote Oct 25, 2018
6a58f29
failing test
lasote Oct 25, 2018
e9d26cf
Self review
lasote Oct 25, 2018
e44f551
Fixed comparisson
lasote Oct 25, 2018
0f9801a
Renamed function
lasote Oct 25, 2018
feb6bfa
Renamed function
lasote Oct 25, 2018
bae18ab
Server migration
lasote Oct 25, 2018
e3c140b
Fixed migrations
lasote Oct 25, 2018
6f7a4f5
protect migration
lasote Oct 25, 2018
1f5a651
Model for package metadata
lasote Oct 26, 2018
9c89276
New package metadata revisions approach
lasote Oct 27, 2018
9f41362
Revisions with metadata ok
lasote Oct 28, 2018
9e905b2
self revision
lasote Oct 28, 2018
5313f78
Merged with develop
lasote Oct 29, 2018
511438f
Fixing diff delete
lasote Oct 29, 2018
668551e
Merge develop
lasote Oct 29, 2018
47004e3
Rev0 scales as any other
lasote Oct 30, 2018
979fddc
Not necessary upload URLs in v2
lasote Oct 30, 2018
17a237b
Unused include
lasote Oct 31, 2018
67ed2df
WIP remove endpoint changes
lasote Oct 31, 2018
dadcfc9
Remove controllers implemented
lasote Oct 31, 2018
138cd82
Merged develop
lasote Oct 31, 2018
02bb9eb
Separated search controller
lasote Oct 31, 2018
3e89f7e
Removed all revs in search v1
lasote Oct 31, 2018
54e987b
Middle revision
lasote Nov 7, 2018
7376060
Finishing review
lasote Nov 7, 2018
101029a
merged develop restored recorder
lasote Nov 7, 2018
002cf98
Nigthly full
lasote Nov 7, 2018
62ae9b3
Fix comparisson < > of a ref with revision and another one without re…
lasote Nov 7, 2018
6eb500d
Fixed graph test
lasote Nov 7, 2018
164b87e
Try if macos doesnt hang anymore
lasote Nov 7, 2018
0be4fdd
to be released in 1.10
lasote Nov 8, 2018
b96aa41
Merged with develop
lasote Nov 8, 2018
5e8f97d
Fixing tests and new remote iteration for revisions
lasote Nov 8, 2018
d2637f6
Review
lasote Nov 12, 2018
1a865b8
Recovered export dir calculation
lasote Nov 12, 2018
6d87c93
Testing more
lasote Nov 14, 2018
03eec1f
WIP
lasote Nov 15, 2018
c484b06
Some more tests
lasote Nov 17, 2018
e9be8d2
Not needed a new flag for v1, we have the capabilities
lasote Nov 17, 2018
79c1871
Fixed test corner case
lasote Nov 20, 2018
0357bd6
wip
lasote Nov 21, 2018
5a0b1c1
finished review
lasote Nov 21, 2018
6ad94ac
0 revs in graph
lasote Nov 22, 2018
cca8dcd
review
lasote Nov 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
158 changes: 72 additions & 86 deletions .ci/jenkins/Jenkinsfile
@@ -1,26 +1,29 @@
// ########## CONFIGURATION ##################
def full_py_vers = false
def test_v2 = false
def test_revisions = true
// ############################

if(env.JOB_NAME == "ConanNightly"){
full_py_vers = true
test_revisions = true
}

if (env.BRANCH_NAME =~ /(^release.*)|(^master)/) {
full_py_vers = true
}

def slaves = ['Linux', 'Windows', 'Macos']
def flavors = ["no_revisions"]


def flavors = ["blocked_v2"]
if(test_revisions){
flavors = ["blocked_v2", "disabled_revisions", "enabled_revisions"]
}
def pyvers = ['py36', 'py27']
def api_confs = ["v1"]

if (full_py_vers){
pyvers = ['py37', 'py36', 'py34', 'py27']
}
else if(test_v2){
api_confs = ["v1", "v2"]
}



def module = "\"conans.test\""
Expand All @@ -39,94 +42,77 @@ try{
for (x in slaves) {
def slave = x
for (y in pyvers) {
for (z in api_confs){
def pyver = y
if(slave != "Linux" && pyver=="py37"){
continue;
}

def api_conf = z
def name = "${slave} - ${flavor} - ${pyver} - API${api_conf}"

if (api_conf == "v2" && slave != "Linux"){
continue;
}

if (flavor == "revisions" && api_conf == "v1"){
continue;
}

if (flavor == "revisions" && pyver == "py34"){
continue;
}
def pyver = y
if(slave != "Linux" && pyver=="py37"){
continue;
}
def name = "${slave} - ${flavor} - ${pyver}"
builders[name] = {
node(slave) {
stage(name){
def workdir
def sourcedir
def base_source
lock('source_code') { // Prepare a clean new directory with the sources
try{
step ([$class: 'WsCleanup'])
}
catch(e){
echo "Cannot clean WS"
}

builders[name] = {
node(slave) {
stage(name){
def workdir
def sourcedir
def base_source
lock('source_code') { // Prepare a clean new directory with the sources
try{
step ([$class: 'WsCleanup'])
}
catch(e){
echo "Cannot clean WS"
}
def vars = checkout scm
commit = vars["GIT_COMMIT"].substring(0, 4)
branch = vars["GIT_BRANCH"]
def base_dir = (slave == "Windows") ? win_tmp_base : rest_tmp_base
workdir = "${base_dir}${commit}/${pyver}/${flavor}"
base_source = "${base_dir}source/${commit}"
sourcedir = "${base_source}/${pyver}/${flavor}"
while(fileExists(sourcedir)){
sourcedir = sourcedir + "_"
}

def vars = checkout scm
commit = vars["GIT_COMMIT"].substring(0, 4)
branch = vars["GIT_BRANCH"]
def base_dir = (slave == "Windows") ? win_tmp_base : rest_tmp_base
workdir = "${base_dir}${commit}/${pyver}/${api_conf}"
base_source = "${base_dir}source/${commit}"
sourcedir = "${base_source}/${pyver}/${api_conf}"
while(fileExists(sourcedir)){
sourcedir = sourcedir + "_"
dir(base_source){ // Trick to create the parent
def escaped_ws = "${WORKSPACE}".replace("\\", "/")
def cmd = "python -c \"import shutil; shutil.copytree('${escaped_ws}', '${sourcedir}')\""
if (slave == "Windows"){
bat(script: cmd)
}

dir(base_source){ // Trick to create the parent
def escaped_ws = "${WORKSPACE}".replace("\\", "/")
def cmd = "python -c \"import shutil; shutil.copytree('${escaped_ws}', '${sourcedir}')\""
if (slave == "Windows"){
bat(script: cmd)
}
else{
sh(script: cmd)
}
else{
sh(script: cmd)
}
}
if(slave == "Linux"){
sh "docker pull lasote/conantests"
docker.image('lasote/conantests').inside("-e CONAN_USER_HOME=${sourcedir} -v${sourcedir}:${sourcedir}") {
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores} --server_api=${api_conf} -f ${flavor}")
}
}
if(slave == "Linux"){
sh "docker pull lasote/conantests"
docker.image('lasote/conantests').inside("-e CONAN_USER_HOME=${sourcedir} -v${sourcedir}:${sourcedir}") {
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores} --flavor ${flavor}")
}
else if(slave == "Windows"){
try{
}
else if(slave == "Windows"){
try{

withEnv(["CONAN_TEST_FOLDER=${workdir}"]){
bat(script: "python ${runner} ${module} ${pyver} ${sourcedir} \"${workdir}\" -e rest_api -e windows_ci_excluded ${numcores} --server_api=${api_conf} -f ${flavor}")
}
}
finally{
bat(script: "rd /s /q \"${workdir}\"")
bat(script: "rd /s /q \"${sourcedir}\"")
}
withEnv(["CONAN_TEST_FOLDER=${workdir}"]){
bat(script: "python ${runner} ${module} ${pyver} ${sourcedir} \"${workdir}\" -e rest_api -e windows_ci_excluded ${numcores} --flavor ${flavor}")
}
}
else if(slave == "Macos"){
try{
withEnv(['PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin']) {
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores} --server_api=${api_conf} -f ${flavor}")
}
}
finally{
sh(script: "rm -rf ${workdir}")
sh(script: "rm -rf ${sourcedir}")
}
finally{
bat(script: "rd /s /q \"${workdir}\"")
bat(script: "rd /s /q \"${sourcedir}\"")
}
}
else if(slave == "Macos"){
try{
withEnv(['PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin']) {
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores} --flavor ${flavor}")
}
}
finally{
sh(script: "rm -rf ${workdir}")
sh(script: "rm -rf ${sourcedir}")
}
//step([$class: 'JUnitResultArchiver', testResults: '**/nosetests.xml'])
}
//step([$class: 'JUnitResultArchiver', testResults: '**/nosetests.xml'])
}
}
}
Expand Down Expand Up @@ -195,6 +181,6 @@ if(env.JOB_NAME == "ConanNightly"){
def build_linux(){
sh "docker pull lasote/conantests"
docker.image('lasote/conantests').inside("-e CONAN_USER_HOME=${sourcedir} -v${sourcedir}:${sourcedir}") {
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores} --server_api=${api_conf}")
sh(script: "python ${runner} ${module} ${pyver} ${sourcedir} ${workdir} -e rest_api ${numcores}")
}
}
23 changes: 7 additions & 16 deletions .ci/jenkins/runner.py
Expand Up @@ -9,8 +9,8 @@
"Darwin": macpylocation}[platform.system()]


def run_tests(module_path, pyver, source_folder, tmp_folder, flavor,
excluded_tags, num_cores=3, verbosity=None, server_api=None):
def run_tests(module_path, pyver, source_folder, tmp_folder, flavor, excluded_tags,
num_cores=3, verbosity=None):

verbosity = verbosity or (2 if platform.system() == "Windows" else 1)
venv_dest = os.path.join(tmp_folder, "venv")
Expand All @@ -20,11 +20,6 @@ def run_tests(module_path, pyver, source_folder, tmp_folder, flavor,
"bin" if platform.system() != "Windows" else "Scripts",
"activate")

if flavor == "revisions":
excluded_tags.append("only_without_revisions")
elif flavor == "no_revisions":
excluded_tags.append("only_revisions")

exluded_tags_str = '-A "%s"' % " and ".join(["not %s" % tag for tag in excluded_tags]) if excluded_tags else ""

pyenv = pylocations[pyver]
Expand All @@ -33,7 +28,7 @@ def run_tests(module_path, pyver, source_folder, tmp_folder, flavor,
debug_traces = "" # "--debug=nose,nose.result" if platform.system() == "Darwin" and pyver != "py27" else ""
# pyenv = "/usr/local/bin/python2"
multiprocess = ("--processes=%s --process-timeout=1000 "
"--process-restartworker --with-coverage" % num_cores) if platform.system() != "Darwin" or pyver == "py27" else ""
"--process-restartworker --with-coverage" % num_cores) if platform.system() != "Darwin" else ""

if num_cores <= 1:
multiprocess = ""
Expand Down Expand Up @@ -71,10 +66,8 @@ def run_tests(module_path, pyver, source_folder, tmp_folder, flavor,
env["PYTHONPATH"] = source_folder
env["CONAN_LOGGING_LEVEL"] = "50" if platform.system() == "Darwin" else "50"
env["CHANGE_AUTHOR_DISPLAY_NAME"] = ""
if server_api == "v2":
env["CONAN_TESTING_SERVER_V2_ENABLED"] = "1"
if flavor == "revisions":
env["CONAN_TESTING_SERVER_REVISIONS_ENABLED"] = "1"
env["CONAN_API_V2_BLOCKED"] = "True" if flavor == "blocked_v2" else "False"
env["CONAN_CLIENT_REVISIONS_ENABLED"] = "True" if flavor == "enabled_revisions" else "False"

with chdir(source_folder):
with environment_append(env):
Expand Down Expand Up @@ -103,12 +96,10 @@ def run(command):
parser.add_argument('source_folder', help='Folder containing the conan source code')
parser.add_argument('tmp_folder', help='Folder to create the venv inside')
parser.add_argument('--num_cores', type=int, help='Number of cores to use', default=3)
parser.add_argument('--server_api', help='Test all with v1 or v2', default="v1")
parser.add_argument('--exclude_tag', '-e', nargs=1, action=Extender,
help='Tags to exclude from testing, e.g.: rest_api')
parser.add_argument('--flavor', '-f', help='Flavor (revisions, no_revisions)')

parser.add_argument('--flavor', '-f', help='enabled_revisions, disabled_revisions, blocked_v2')
args = parser.parse_args()

run_tests(args.module, args.pyver, args.source_folder, args.tmp_folder, args.flavor,
args.exclude_tag, num_cores=args.num_cores, server_api=args.server_api)
args.exclude_tag, num_cores=args.num_cores)
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -102,4 +102,4 @@ cacert.pem
.noseids

# add excluded
!conans/client/build
!conans/client/build
4 changes: 2 additions & 2 deletions conans/__init__.py
Expand Up @@ -13,9 +13,9 @@

# complex_search: With ORs and not filtering by not restricted settings
COMPLEX_SEARCH_CAPABILITY = "complex_search"
API_V2 = "api_v2"
CHECKSUM_DEPLOY = "checksum_deploy" # Only when v2
REVISIONS = "revisions" # Only when enabled in config, not by default look at server_launcher.py
SERVER_CAPABILITIES = [COMPLEX_SEARCH_CAPABILITY, ] # Still without v2 because it is changing
SERVER_CAPABILITIES = [COMPLEX_SEARCH_CAPABILITY, REVISIONS] # Server is always with revisions
DEFAULT_REVISION_V1 = "0"

__version__ = '1.10.0-dev'
32 changes: 27 additions & 5 deletions conans/client/client_cache.py
@@ -1,24 +1,27 @@
import os
import shutil
from os.path import join, normpath
from collections import OrderedDict
from contextlib import contextmanager
from os.path import join, normpath

import shutil

from conans import DEFAULT_REVISION_V1
from conans.client.conf import ConanClientConfigParser, default_client_conf, default_settings_yml
from conans.client.conf.detect import detect_defaults_settings
from conans.client.output import Color
from conans.client.profile_loader import read_profile
from conans.client.remote_registry import migrate_registry_file, dump_registry, default_remotes
from conans.errors import ConanException
from conans.model.manifest import FileTreeManifest
from conans.model.package_metadata import PackageMetadata
from conans.model.profile import Profile
from conans.model.ref import ConanFileReference
from conans.model.settings import Settings
from conans.paths import SimplePaths, PUT_HEADERS, check_ref_case,\
from conans.paths import SimplePaths, PUT_HEADERS, check_ref_case, \
CONAN_MANIFEST
from conans.unicode import get_cwd
from conans.util.files import save, load, normalize, list_folder_subdirs
from conans.util.locks import SimpleLock, ReadLock, WriteLock, NoLock, Lock
from conans.unicode import get_cwd


CONAN_CONF = 'conan.conf'
CONAN_SETTINGS = "settings.yml"
Expand Down Expand Up @@ -293,6 +296,25 @@ def invalidate(self):
self._default_profile = None
self._no_lock = None

# Metadata
def load_metadata(self, conan_reference):
try:
text = load(self.package_metadata(conan_reference))
return PackageMetadata.loads(text)
except IOError:
return PackageMetadata()

@contextmanager
def update_metadata(self, conan_reference):
metadata = self.load_metadata(conan_reference)
yield metadata
save(self.package_metadata(conan_reference), metadata.dumps())
jgsogo marked this conversation as resolved.
Show resolved Hide resolved

# Revisions
def package_summary_hash(self, package_ref):
readed_digest, expected_digest = self.package_manifests(package_ref)
lasote marked this conversation as resolved.
Show resolved Hide resolved
return expected_digest.summary_hash


def _mix_settings_with_env(settings):
"""Reads CONAN_ENV_XXXX variables from environment
Expand Down
2 changes: 1 addition & 1 deletion conans/client/cmd/download.py
@@ -1,9 +1,9 @@
import os

from conans.model.ref import PackageReference, ConanFileReference
from conans.client.output import ScopedOutput
from conans.client.source import complete_recipe_sources
from conans.errors import NotFoundException
from conans.model.ref import PackageReference, ConanFileReference


def download(reference, package_ids, remote_name, recipe, registry, remote_manager,
Expand Down