Skip to content

Commit

Permalink
Remove chainlik image from create config tool
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcl committed Jul 9, 2024
1 parent 28b0e4a commit 7961538
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 40 deletions.
16 changes: 0 additions & 16 deletions .github/actions/create-default-e2e-config-override/action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
name: 'Create Default E2E Test Config Override From Inputs'
inputs:
chainlink_image:
required: false
description: 'Chainlink image to use for the tests. Example: "chainlink/chainlink:develop"'
chainlink_version:
required: false
description: 'Chainlink version to use for the tests. Example: "v2.10.0" or sha'
chainlink_postgres_version:
required: false
description: 'Chainlink Postgres version to use for the tests'
chainlink_upgrade_image:
required: false
description: 'Chainlink upgrade image to use for the tests'
chainlink_upgrade_version:
required: false
description: 'Chainlink upgrade version to use for the tests'
Expand Down Expand Up @@ -61,9 +55,6 @@ inputs:
required: false
description: 'Private Ethereum network custom Docker image for the tests'
outputs:
chainlink_image:
value: ${{ steps.build-args.outputs.chainlink_image }}
description: 'Chainlink image resolved from the input'
chainlink_version:
value: ${{ steps.build-args.outputs.chainlink_version }}
description: 'Chainlink version resolved from the input'
Expand All @@ -78,20 +69,13 @@ runs:
cd integration-tests/e2e_tests_ci_tool/
create_args=()
if [ -n "${{ inputs.chainlink_image }}" ]; then
create_args+=(--chainlink-image="${{ inputs.chainlink_image }}")
echo "chainlink_image=$(go run main.go envresolve "${{ inputs.chainlink_image }}")" >> $GITHUB_OUTPUT
fi
if [ -n "${{ inputs.chainlink_version }}" ]; then
create_args+=(--chainlink-version="${{ inputs.chainlink_version }}")
echo "chainlink_version=$(go run main.go envresolve "${{ inputs.chainlink_version }}")" >> $GITHUB_OUTPUT
fi
if [ -n "${{ inputs.chainlink_postgres_version }}" ]; then
create_args+=(--chainlink-postgres-version="${{ inputs.chainlink_postgres_version }}")
fi
if [ -n "${{ inputs.chainlink_upgrade_image }}" ]; then
create_args+=(--chainlink-upgrade-image="${{ inputs.chainlink_upgrade_image }}")
fi
if [ -n "${{ inputs.chainlink_upgrade_version }}" ]; then
create_args+=(--chainlink-upgrade-version="${{ inputs.chainlink_upgrade_version }}")
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-e2e-tests-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ jobs:
with:
test_command_to_run: ${{ matrix.tests.testCmd }}
test_download_vendor_packages_command: make gomod
cl_repo: ${{ steps.create-default-test-config-override.outputs.chainlink_image }}
cl_repo: ${{ matrix.tests.testInputs.chainlinkImage || env.CHAINLINK_IMAGE }}
cl_image_tag: ${{ steps.create-default-test-config-override.outputs.chainlink_version }}
token: ${{ secrets.GH_TOKEN }}
should_cleanup: false
Expand Down
16 changes: 4 additions & 12 deletions integration-tests/e2e_tests_ci_tool/cmd/create_test_config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,26 @@ var createTestConfigCmd = &cobra.Command{
Run: func(cmd *cobra.Command, _ []string) {
var tc ctf_config.TestConfig

var image, version, postgresVersion *string
if cmd.Flags().Changed(ChainlinkImageFlag) {
image = &oc.ChainlinkImage
}
var version, postgresVersion *string
if cmd.Flags().Changed(ChainlinkVersionFlag) {
version = &oc.ChainlinkVersion
}
if cmd.Flags().Changed(ChainlinkPostgresVersionFlag) {
version = &oc.ChainlinkPostgresVersion
}
if image != nil && version != nil {
if version != nil || postgresVersion != nil {
tc.ChainlinkImage = &ctf_config.ChainlinkImageConfig{
Image: image,
Version: version,
PostgresVersion: postgresVersion,
}
}

var upgradeImage, upgradeVersion *string
if cmd.Flags().Changed(ChainlinkUpgradeImageFlag) {
upgradeImage = &oc.ChainlinkUpgradeImage
}
var upgradeVersion *string
if cmd.Flags().Changed(ChainlinkUpgradeVersionFlag) {
upgradeVersion = &oc.ChainlinkUpgradeVersion
}
if upgradeImage != nil || upgradeVersion != nil {
if upgradeVersion != nil {
tc.ChainlinkUpgradeImage = &ctf_config.ChainlinkImageConfig{
Image: upgradeImage,
Version: upgradeVersion,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ var overrideTestConfigCmd = &cobra.Command{

cmd.Flags().Visit(func(flag *pflag.Flag) {
switch flag.Name {
case ChainlinkImageFlag:
if baseConfig.ChainlinkImage != nil && baseConfig.ChainlinkImage.Image != nil {
logIfDryRun(dryRun, "Found 'ChainlinkImage.Image' in config. Will override it with %s\n", ChainlinkImageFlag)
baseConfig.ChainlinkImage.Image = &oc.ChainlinkImage
} else {
logIfDryRun(dryRun, "No 'ChainlinkImage.Image' in config. Will NOT OVERRIDE with %s\n", ChainlinkImageFlag)
}
case ChainlinkVersionFlag:
if baseConfig.ChainlinkImage != nil && baseConfig.ChainlinkImage.Version != nil {
logIfDryRun(dryRun, "Found 'ChainlinkImage.Version' in config. Will override it with %s\n", ChainlinkVersionFlag)
Expand Down
4 changes: 0 additions & 4 deletions integration-tests/e2e_tests_ci_tool/cmd/test_config_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ type OverrideConfig struct {
}

const (
ChainlinkImageFlag = "chainlink-image"
ChainlinkVersionFlag = "chainlink-version"
ChainlinkUpgradeImageFlag = "chainlink-upgrade-image"
ChainlinkUpgradeVersionFlag = "chainlink-upgrade-version"
ChainlinkPostgresVersionFlag = "chainlink-postgres-version"
SelectedNetworksFlag = "selected-networks"
Expand Down Expand Up @@ -72,9 +70,7 @@ func init() {
cmds := []*cobra.Command{createTestConfigCmd, overrideTestConfigCmd}
for _, c := range cmds {
c.Flags().StringArrayVar(&oc.SelectedNetworks, SelectedNetworksFlag, nil, "Selected networks")
c.Flags().StringVar(&oc.ChainlinkImage, ChainlinkImageFlag, "", "Chainlink image")
c.Flags().StringVar(&oc.ChainlinkVersion, ChainlinkVersionFlag, "", "Chainlink version")
c.Flags().StringVar(&oc.ChainlinkUpgradeImage, ChainlinkUpgradeImageFlag, "", "Chainlink upgrade image")
c.Flags().StringVar(&oc.ChainlinkUpgradeVersion, ChainlinkUpgradeVersionFlag, "", "Chainlink upgrade version")
c.Flags().StringVar(&oc.ChainlinkPostgresVersion, ChainlinkPostgresVersionFlag, "", "Chainlink Postgres version")
c.Flags().BoolVar(&oc.PyroscopeEnabled, PyroscopeEnabledFlag, false, "Pyroscope enabled")
Expand Down

0 comments on commit 7961538

Please sign in to comment.