This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
Fix image scripts not being included in user deploy #592
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0010196
Fix image scripts not being included in user deploy
cdosborn 7b95d9a
Remove dead code
cdosborn 3947f07
Skip broken test
cdosborn 7c66914
Prefer testing fewer things
cdosborn 87fd061
Prefer testing fewer things
cdosborn 46666ed
Add test to verify ansible is called with image and instance scripts
cdosborn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import factory | ||
from factory import fuzzy | ||
from api.tests.factories import UserFactory, InstanceFactory | ||
from core.models import BootScript, ScriptType | ||
|
||
|
||
class BootScriptFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = BootScript | ||
|
||
title = fuzzy.FuzzyText(prefix="bootscript-title-") | ||
created_by = factory.SubFactory(UserFactory) | ||
|
||
|
||
class BootScriptRawTextFactory(BootScriptFactory): | ||
script_type = factory.LazyAttribute(lambda _: ScriptType.objects.get_or_create(name='Raw Text')[0]) | ||
|
||
|
||
class BootScriptURLFactory(BootScriptFactory): | ||
script_type = factory.LazyAttribute(lambda _: ScriptType.objects.get_or_create(name='URL')[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import factory | ||
from factory import fuzzy | ||
from core.models import Group | ||
|
||
|
||
class GroupFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = Group | ||
|
||
name = fuzzy.FuzzyText(prefix="name-") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import factory | ||
from core.models import Application as Image | ||
from .user_factory import UserFactory | ||
|
||
|
||
class ImageFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = Image | ||
|
||
created_by = factory.SubFactory(UserFactory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
import factory | ||
from core.models import Instance | ||
from django.utils import timezone | ||
from .user_factory import UserFactory | ||
from .project_factory import ProjectFactory | ||
from .instance_source_factory import InstanceSourceFactory | ||
from .provider_machine_factory import ProviderMachineFactory | ||
from .identity_factory import IdentityFactory | ||
|
||
|
||
|
||
class InstanceFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = Instance | ||
exclude = ('provider_machine',) | ||
|
||
provider_machine = factory.SubFactory(ProviderMachineFactory) | ||
start_date = factory.LazyFunction(timezone.now) | ||
project = factory.SubFactory(ProjectFactory) | ||
source = factory.SelfAttribute('provider_machine.instance_source') | ||
created_by = factory.SubFactory(UserFactory) | ||
created_by_identity = factory.LazyAttribute( | ||
lambda model: IdentityFactory(created_by=model.created_by)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import factory | ||
import uuid | ||
from core.models import ProviderMachine, InstanceSource | ||
from .provider_factory import ProviderFactory | ||
|
||
class InstanceSourceFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = InstanceSource | ||
|
||
identifier = factory.Sequence(lambda n: uuid.uuid4()) | ||
provider = factory.SubFactory(ProviderFactory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
import factory | ||
from factory import fuzzy | ||
from core.models import Project | ||
|
||
from .group_factory import GroupFactory | ||
from .user_factory import UserFactory | ||
|
||
|
||
class ProjectFactory(factory.DjangoModelFactory): | ||
|
||
class Meta: | ||
model = Project | ||
|
||
name = 'project name' | ||
description = 'project description' | ||
name = fuzzy.FuzzyText(prefix="name-") | ||
description = fuzzy.FuzzyText(prefix="description-") | ||
created_by = factory.SubFactory(UserFactory) | ||
owner = factory.SubFactory(GroupFactory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch.