GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore(e2e): add e2e tests for sidecars by iamhopaul123 · Pull Request #1011 · aws/copilot-cli

This repository was archived by the owner on Jun 22, 2026. It is now read-only.

Conversation

@iamhopaul123

@iamhopaul123 iamhopaul123 commented Jun 10, 2020

Copy link
Copy Markdown
Contributor

Fixes #1008.

(I'm gonna rest in peace. Put the e2e test log on my grave and don't include any PR reviews other than LGTM)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iamhopaul123
iamhopaul123 requested review from a team, Louise15926, SoManyHs, bvtujo, efekarakus, huanjani, kohidave and seongm-1 June 10, 2020 21:52
@iamhopaul123
chore(e2e): add e2e tests for sidecars
010c533
@iamhopaul123
iamhopaul123 force-pushed the e2e/sidecars branch from aa03d75 to 010c533 Compare June 10, 2020 21:57
kohidave
kohidave reviewed Jun 10, 2020
View reviewed changes

@kohidave kohidave left a comment

Copy link
Copy Markdown
Contributor

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.

This looks so delightful! Thank you :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread e2e/e2e.sh Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/internal/command/command.go
@@ -0,0 +1,42 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@kohidave kohidave Jun 10, 2020

Copy link
Copy Markdown
Contributor

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.

Might be nice to have an AwsCLI struct, like we have for the CopilotCLI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

Maybe it's not a good idea since the reason why we have a struct for copilot is because of mocking.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go
Comment on lines +157 to +174
It("create new ECR repo for sidecar", func() {
var b bytes.Buffer
err := command.Run("bash", []string{"-c", fmt.Sprintf("aws ecr create-repository --repository-name %s | jq -r .repository.repositoryUri", sidecarRepoName)}, command.Stdout(&b))
Expect(err).NotTo(HaveOccurred(), "create ECR repo for sidecar")
uri = strings.TrimSpace(b.String())
sidecarImageURI = fmt.Sprintf("%s:%s", uri, tag)
})
It("push sidecar image", func() {
var b bytes.Buffer
err := command.Run("aws", []string{"ecr", "get-login-password"}, command.Stdout(&b))
password := b.String()
Expect(err).NotTo(HaveOccurred(), "get ecr login password")
err = command.Run("docker", []string{"login", "-u", "AWS", "--password-stdin", uri}, command.Stdin(strings.NewReader(password)))
Expect(err).NotTo(HaveOccurred(), "docker login")
err = command.Run("docker", []string{"build", "-t", sidecarImageURI, "./nginx"})
Expect(err).NotTo(HaveOccurred(), "build sidecar image")
err = command.Run("docker", []string{"push", sidecarImageURI})
Expect(err).NotTo(HaveOccurred(), "push to ECR repo")

@kohidave kohidave Jun 10, 2020

Copy link
Copy Markdown
Contributor

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.

Do you think this should be a BeforeAll of the 'write manifest file' section?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

Yeah that's a good idea!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

i tried to use BeforeAll but it seems like inside of beforeAll it doesn't allow me to have multiple It(). so i'll leave it as it is now.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

efekarakus
efekarakus reviewed Jun 11, 2020
View reviewed changes

@efekarakus efekarakus left a comment

Copy link
Copy Markdown
Contributor

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.

Looks really good!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread e2e/sidecars/hello/server.js
const lorem = require('lorem-ipsum')

// Log requests
app.use(function *(next){

@efekarakus efekarakus Jun 11, 2020

Copy link
Copy Markdown
Contributor

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.

Wow it's the first time that I see the generator syntax in JS! :O

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread e2e/sidecars/sidecars_test.go

for _, logLine := range svcLogs {
Expect(logLine.Message).NotTo(Equal(""))
Expect(logLine.LogStreamName).NotTo(Equal(""))

@efekarakus efekarakus Jun 11, 2020

Copy link
Copy Markdown
Contributor

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.

maybe we can validate that the logstreamname is the custom one that firelens set for us?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020

Copy link
Copy Markdown
Contributor Author

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.

But the thing is it contains not only the logs from firelens but also nginx logs and the logs for firelens itself...

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@iamhopaul123 iamhopaul123 Jun 11, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

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.

maybe i can try to check if the log stream name falls into these three options. But still we don't know the full name for the log streams unless we query it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@iamhopaul123
Address feedbacks
02b0666
@iamhopaul123
iamhopaul123 force-pushed the e2e/sidecars branch from 9821825 to 02b0666 Compare June 11, 2020 19:54
efekarakus
efekarakus approved these changes Jun 11, 2020
View reviewed changes
kohidave
kohidave approved these changes Jun 11, 2020
View reviewed changes
@mergify
Merge branch 'master' into e2e/sidecars
8db2220
@mergify
mergify Bot merged commit 165c106 into aws:master Jun 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@Louise15926 Louise15926 Awaiting requested review from Louise15926
@bvtujo bvtujo Awaiting requested review from bvtujo
@SoManyHs SoManyHs Awaiting requested review from SoManyHs
@seongm-1 seongm-1 Awaiting requested review from seongm-1
@huanjani huanjani Awaiting requested review from huanjani
2 more reviewers
@kohidave kohidave kohidave approved these changes
@efekarakus efekarakus efekarakus approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Sidecars e2e tests

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@iamhopaul123 @kohidave @efekarakus
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.