-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds 'dot' test * Variable Rename * Removed scaffold and dot CI test
- Loading branch information
1 parent
5ed10c1
commit c0a62ea
Showing
4 changed files
with
43 additions
and
61 deletions.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,43 @@ | ||
from click.testing import CliRunner | ||
|
||
import popper.commands.cmd_dot as dot | ||
import popper.commands.cmd_run as run | ||
from test_common import PopperTest | ||
from popper.parser import Workflow, YMLWorkflow, HCLWorkflow | ||
|
||
import unittest | ||
import os | ||
import tempfile | ||
import git | ||
|
||
|
||
class TestDot(PopperTest): | ||
|
||
def test_dot(self): | ||
|
||
wf_dir = tempfile.mkdtemp() | ||
runner = CliRunner() | ||
git.Git(wf_dir).clone( | ||
"https://github.com/popperized/github-actions-demo.git") | ||
|
||
workflow_path = f'{wf_dir}/github-actions-demo/.github/main.workflow' | ||
|
||
with self.assertLogs('popper') as test_logger: | ||
|
||
result = runner.invoke(dot.cli, ['-f', workflow_path]) | ||
self.assertEqual(result.exit_code, 0) | ||
log_output = test_logger.output[0] | ||
self.assertTrue('"branch-filter" -> "deploy";' in log_output) | ||
self.assertTrue('"install" -> "lint";' in log_output) | ||
self.assertTrue('"install" -> "test";' in log_output) | ||
self.assertTrue('"lint" -> "branch-filter";' in log_output) | ||
self.assertTrue('"test-and-deploy" -> "install";' in log_output) | ||
self.assertTrue('"test" -> "branch-filter"' in log_output) | ||
self.assertFalse('fillcolor=transparent,color=' in log_output) | ||
|
||
with self.assertLogs('popper') as test_logger: | ||
|
||
result = runner.invoke(dot.cli, ['--colors', '-f', workflow_path]) | ||
self.assertEqual(result.exit_code, 0) | ||
self.assertTrue( | ||
'fillcolor=transparent,color=' in test_logger.output[0]) |