Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • willsalmon/buildstream
  • CumHoleZH/buildstream
  • tchaik/buildstream
  • DCotyPortfolio/buildstream
  • jesusoctavioas/buildstream
  • patrickmmartin/buildstream
  • franred/buildstream
  • tintou/buildstream
  • alatiera/buildstream
  • martinblanchard/buildstream
  • neverdie22042524/buildstream
  • Mattlk13/buildstream
  • PServers/buildstream
  • phamnghia610909/buildstream
  • chiaratolentino/buildstream
  • eysz7-x-x/buildstream
  • kerrick1/buildstream
  • matthew-yates/buildstream
  • twofeathers/buildstream
  • mhadjimichael/buildstream
  • pointswaves/buildstream
  • Mr.JackWilson/buildstream
  • Tw3akG33k/buildstream
  • AlexFazakas/buildstream
  • eruidfkiy/buildstream
  • clamotion2/buildstream
  • nanonyme/buildstream
  • wickyjaaa/buildstream
  • nmanchev/buildstream
  • bojorquez.ja/buildstream
  • mostynb/buildstream
  • highpit74/buildstream
  • Demo112/buildstream
  • ba2014sheer/buildstream
  • tonimadrino/buildstream
  • usuario2o/buildstream
  • Angelika123456/buildstream
  • neo355/buildstream
  • corentin-ferlay/buildstream
  • coldtom/buildstream
  • wifitvbox81/buildstream
  • 358253885/buildstream
  • seanborg/buildstream
  • SotK/buildstream
  • DouglasWinship/buildstream
  • karansthr97/buildstream
  • louib/buildstream
  • bwh-ct/buildstream
  • robjh/buildstream
  • we88c0de/buildstream
  • zhengxian5555/buildstream
51 results
Show changes
kind: import
description: test
sources:
- kind: remote
url: tmpdir:/dir/file
ref: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
filename: some-custom-file
executable: true
......@@ -2,3 +2,4 @@ from .runcli import cli, cli_integration
from .repo import create_repo, ALL_REPO_KINDS
from .artifactshare import create_artifact_share
from .element_generators import create_element_size
from .junction import generate_junction
......@@ -18,11 +18,12 @@ from buildstream import _yaml
# Returns:
# Nothing (creates a .bst file of specified size)
#
def create_element_size(name, path, dependencies, size):
os.makedirs(path, exist_ok=True)
def create_element_size(name, project_dir, elements_path, dependencies, size):
full_elements_path = os.path.join(project_dir, elements_path)
os.makedirs(full_elements_path, exist_ok=True)
# Create a file to be included in this element's artifact
with open(os.path.join(path, name + '_data'), 'wb+') as f:
with open(os.path.join(project_dir, name + '_data'), 'wb+') as f:
f.write(os.urandom(size))
# Simplest case: We want this file (of specified size) to just
......@@ -32,9 +33,9 @@ def create_element_size(name, path, dependencies, size):
'sources': [
{
'kind': 'local',
'path': os.path.join(path, name + '_data')
'path': name + '_data'
}
],
'depends': dependencies
}
_yaml.dump(element, os.path.join(path, name))
_yaml.dump(element, os.path.join(project_dir, elements_path, name))
#
# Copyright (C) 2018 Codethink Limited
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
#
# Authors:
# Tiago Gomes <tiago.gomes@codethink.co.uk>
import os
import socket
# generate_file_types()
#
# Generator that creates a regular file directory, symbolic link, fifo
# and socket at the specified path.
#
# Args:
# path: (str) path where to create each different type of file
#
def generate_file_types(path):
def clean():
if os.path.exists(path):
if os.path.isdir(path):
os.rmdir(path)
else:
os.remove(path)
clean()
with open(path, 'w') as f:
pass
yield
clean()
os.makedirs(path)
yield
clean()
os.symlink("project.conf", path)
yield
clean()
os.mkfifo(path)
yield
clean()
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
s.bind(path)
yield
clean()
import os
from tests.testutils import create_repo
from buildstream import _yaml
# generate_junction()
#
# Generates a junction element with a git repository
#
# Args:
# tmpdir: The tmpdir fixture, for storing the generated git repo
# subproject_path: The path for the subproject, to add to the git repo
# junction_path: The location to store the generated junction element
# store_ref: Whether to store the ref in the junction.bst file
#
# Returns:
# (str): The ref
#
def generate_junction(tmpdir, subproject_path, junction_path, *, store_ref=True):
# Create a repo to hold the subproject and generate
# a junction element for it
#
repo = create_repo('git', str(tmpdir))
source_ref = ref = repo.create(subproject_path)
if not store_ref:
source_ref = None
element = {
'kind': 'junction',
'sources': [
repo.source_config(ref=source_ref)
]
}
_yaml.dump(element, junction_path)
return ref
......@@ -33,7 +33,7 @@ def assert_provenance(filename, line, col, node, key=None, indices=[]):
else:
assert(isinstance(provenance, _yaml.DictProvenance))
assert(provenance.filename == filename)
assert(provenance.filename.shortname == filename)
assert(provenance.line == line)
assert(provenance.col == col)
......