(t *testing.T)
| 584 | } |
| 585 | |
| 586 | func TestParseConfig(t *testing.T) { |
| 587 | testCases := []*parseTestCase{ |
| 588 | { |
| 589 | name: "Simple", |
| 590 | in: &parseTestCaseInput{ |
| 591 | config: ` |
| 592 | version: v1beta11`, |
| 593 | options: &ConfigOptions{}, |
| 594 | generatedConfig: &localcache.LocalCache{Vars: map[string]string{}}, |
| 595 | }, |
| 596 | expected: &latest.Config{ |
| 597 | Pipelines: map[string]*latest.Pipeline{ |
| 598 | "build": &latest.Pipeline{}, |
| 599 | "deploy": &latest.Pipeline{}, |
| 600 | "dev": &latest.Pipeline{ |
| 601 | Run: "start_dev --all", |
| 602 | }, |
| 603 | "purge": &latest.Pipeline{ |
| 604 | Run: "stop_dev --all", |
| 605 | }, |
| 606 | }, |
| 607 | Vars: convertedVars, |
| 608 | }, |
| 609 | }, |
| 610 | { |
| 611 | name: "Simple with deployments", |
| 612 | in: &parseTestCaseInput{ |
| 613 | config: ` |
| 614 | version: v1beta3 |
| 615 | deployments: |
| 616 | - name: test |
| 617 | component: |
| 618 | containers: |
| 619 | - image: nginx`, |
| 620 | options: &ConfigOptions{}, |
| 621 | generatedConfig: &localcache.LocalCache{Vars: map[string]string{}}, |
| 622 | }, |
| 623 | expected: &latest.Config{ |
| 624 | Pipelines: testPipeline, |
| 625 | Deployments: map[string]*latest.DeploymentConfig{ |
| 626 | "test": { |
| 627 | Helm: &latest.HelmConfig{ |
| 628 | Values: map[string]interface{}{ |
| 629 | "containers": []interface{}{ |
| 630 | map[string]interface{}{ |
| 631 | "image": "nginx", |
| 632 | }, |
| 633 | }, |
| 634 | }, |
| 635 | }, |
| 636 | }, |
| 637 | }, |
| 638 | Vars: convertedVars, |
| 639 | }, |
| 640 | }, |
| 641 | { |
| 642 | name: "Variables", |
| 643 | in: &parseTestCaseInput{ |
nothing calls this directly
no test coverage detected