--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/complex-global-image-with-login.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,15 @@
+ name: registry.docker.io/python:3 + - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/complex-global-image.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,12 @@
+ - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/complex-step-image-with-login.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,14 @@
+ name: registry.docker.io/python:3 + - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/complex-step-image.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,12 @@
+ - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/complex-step-simple-image.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,11 @@
+ - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/docker-mixed.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,13 @@
+image: gliderlabs/alpine:edge + - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - docker build -t atlassian/my-app:$BITBUCKET_COMMIT . + - docker push atlassian/my-app:$BITBUCKET_COMMIT --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/docker-simple.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,9 @@
+ - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - docker build -t atlassian/my-app:$BITBUCKET_COMMIT . + - docker push atlassian/my-app:$BITBUCKET_COMMIT --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/loaders/bitbucket/data/simple.yml Mon Feb 12 00:24:54 2018 -0600
@@ -0,0 +1,11 @@
+ - find . -type f -iname "*.pyc" -exec rm -f {} \; || true + - find . -type d -iname __pycache__ -exec rm -rf {} \; || true + - pip install -r dev-requirements.txt + - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests --- a/loaders/bitbucket/loader_test.go Sun Feb 11 22:39:39 2018 -0600
+++ b/loaders/bitbucket/loader_test.go Mon Feb 12 00:24:54 2018 -0600
@@ -30,17 +30,7 @@
func (b *bitbucketSuite) TestLoaderSimple(t sweet.T) {
- data := []byte(`image: python:3
- - find . -type f -iname "*.pyc" -exec rm -f {} \; || true
- - find . -type d -iname __pycache__ -exec rm -rf {} \; || true
- - pip install -r dev-requirements.txt
- - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests`)
+ data := t.Sweet().LoadFile("data/simple.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -87,19 +77,7 @@
func (b *bitbucketSuite) TestLoaderComplexGlobalImage(t sweet.T) {
- - find . -type f -iname "*.pyc" -exec rm -f {} \; || true
- - find . -type d -iname __pycache__ -exec rm -rf {} \; || true
- - pip install -r dev-requirements.txt
- - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests`)
+ data := t.Sweet().LoadFile("data/complex-global-image.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -145,22 +123,7 @@
func (b *bitbucketSuite) TestLoaderComplexGlobalImageWithLogin(t sweet.T) {
- name: registry.docker.io/python:3
- - find . -type f -iname "*.pyc" -exec rm -f {} \; || true
- - find . -type d -iname __pycache__ -exec rm -rf {} \; || true
- - pip install -r dev-requirements.txt
- - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests`)
+ data := t.Sweet().LoadFile("data/complex-global-image-with-login.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -211,22 +174,56 @@
Expect(cfg).To(Equal(expected))
+func (b *bitbucketSuite) TestLoaderComplexStepSimpleImage(t sweet.T) { + data := t.Sweet().LoadFile("data/complex-step-simple-image.yml") + cfg, err := l.Load("", "", data, []string{}, true) + Expect(err).To(BeNil()) + expected := &config.Config{ + Tasks: map[string]tasks.Task{ + "import": &docker.Import{ + "default-0": &docker.Run{ + "find . -type f -iname \"*.pyc\" -exec rm -f {} \\; || true", + "find . -type d -iname __pycache__ -exec rm -rf {} \\; || true", + "pip install -r dev-requirements.txt", + "PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests", + Plans: map[string]plans.Plan{ + Stages: []stages.Stage{ + Tasks: []string{"import", "default-0"}, + Expect(cfg).To(Equal(expected)) func (b *bitbucketSuite) TestLoaderComplexStepImage(t sweet.T) {
- data := []byte(`pipelines:
- - find . -type f -iname "*.pyc" -exec rm -f {} \; || true
- - find . -type d -iname __pycache__ -exec rm -rf {} \; || true
- - pip install -r dev-requirements.txt
- - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests`)
+ data := t.Sweet().LoadFile("data/complex-step-image.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -272,21 +269,7 @@
func (b *bitbucketSuite) TestLoaderComplexStepImageWithLogin(t sweet.T) {
- data := []byte(`pipelines:
- name: registry.docker.io/python:3
- - find . -type f -iname "*.pyc" -exec rm -f {} \; || true
- - find . -type d -iname __pycache__ -exec rm -rf {} \; || true
- - pip install -r dev-requirements.txt
- - PYTHONPATH=$(pwd) py.test --color=auto --cov=pipelines --cov-report=term-missing tests`)
+ data := t.Sweet().LoadFile("data/complex-step-image-with-login.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -337,24 +320,51 @@
Expect(cfg).To(Equal(expected))
+func (b *bitbucketSuite) TestLoaderBranchImage(t sweet.T) { + data := t.Sweet().LoadFile("data/branch-image.yml") + cfg, err := l.Load("", "", data, []string{}, true) + Expect(err).To(BeNil()) + expected := &config.Config{ + Tasks: map[string]tasks.Task{ + "import": &docker.Import{ + "branch-develop-0": &docker.Run{ + Image: "library/alpine", + Plans: map[string]plans.Plan{ + Stages: []stages.Stage{ + Tasks: []string{"import", "branch-develop-0"}, + Expect(cfg).To(Equal(expected)) func (b *bitbucketSuite) TestLoaderDockerMixed(t sweet.T) {
- data := []byte(`image: gliderlabs/alpine:edge
- - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- - docker build -t atlassian/my-app:$BITBUCKET_COMMIT .
- - docker push atlassian/my-app:$BITBUCKET_COMMIT
+ data := t.Sweet().LoadFile("data/docker-mixed.yml") cfg, err := l.Load("", "", data, []string{}, true)
@@ -424,17 +434,7 @@
func (b *bitbucketSuite) TestLoaderDockerSimple(t sweet.T) {
- data := []byte(`pipelines:
- - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- - docker build -t atlassian/my-app:$BITBUCKET_COMMIT .
- - docker push atlassian/my-app:$BITBUCKET_COMMIT
+ data := t.Sweet().LoadFile("data/docker-simple.yml") cfg, err := l.Load("", "", data, []string{}, true)