You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/09/01 20:25:31 UTC
[GitHub] [airflow] OmairK opened a new pull request #10682: Cleaning scripts under 'scripts/in_container'
OmairK opened a new pull request #10682:
URL: https://github.com/apache/airflow/pull/10682
Part of #10576
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-714756152
[The Workflow run](https://github.com/apache/airflow/actions/runs/322857790) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-714756315
[The Workflow run](https://github.com/apache/airflow/actions/runs/322860902) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks$,^Build docs$,^Spell check docs$,^Backport packages$,^Checks: Helm tests$,^Test OpenAPI*.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-685158711
I think there are few "outside" containers methods that need to be modified, but the direction is good :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-685161152
> @potiuk I just made this PR just in case if someone else also starts working on this issue. I haven't tested it yet. Kind of wrapping my head around bash scripting 😄
If you need any help or advice - let me know :). Happy to help with my 20+years of bash experience (though every few months I learn something new :D)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] closed pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #10682:
URL: https://github.com/apache/airflow/pull/10682
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] OmairK commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
OmairK commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-685162372
> If you need any help or advice - let me know :). Happy to help with my 20+years of bash experience (though every few months I learn something new :D)
Of course, thanks a lot :smile:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] OmairK commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
OmairK commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-685160324
> See the failing tests
@potiuk I just made this PR just in case if someone else also starts working on this issue. I haven't tested it yet. Kind of wrapping my head around bash scripting :smile:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] werbolis commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
werbolis commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-714724522
@potiuk I've rebased @OmairK 's work to current master and made some improvements to the utils script. Could you take a look? Most of changes outside of the utils script are prefix additions, but some (incomplete) refactoring was done by the way; hopefully it would make further fixing (in a series of small PRs) easier.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] werbolis commented on a change in pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
werbolis commented on a change in pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#discussion_r510405602
##########
File path: tests/bats/test_in_container_utils.bats
##########
@@ -0,0 +1,45 @@
+#!/usr/bin/env bats
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+setup() {
+ load bats_utils
+ source "${AIRFLOW_SOURCES}/scripts/in_container/_in_container_utils.sh"
+}
+
+@test "test success exit" {
+ container_utils::in_container_script_end 1
+ assert_success
+}
+
+@test "test heartbeat start and stop" {
+ container_utils::start_output_heartbeat "Creating kubernetes cluster" 1
+ container_utils::stop_output_heartbeat
+ assert [ -z "$(ps -p $HEARTBEAT_PID -o pid=)" ] && [ -n "$HEARTBEAT_PID" ]
+}
+
+#TODO(werbolis) These (new) tests fail in `breeze static-check bats-tests` run. Investigate & fix.
+# @test "test not in_container" {
+# run container_utils::assert_in_container
+# assert [ $status -eq 1 ]
+# }
+#
+# @test "test install_airflow" {
+# container_utils::install_released_airflow_version "1.10.2"
+# airflow_version=$(airflow version)
+# assert [ airflow_version=="1.10.2" ]
+# }
Review comment:
@OmairK did you aim to run these tests in the local dev env? The pre-commit hook uses `breeze static-check bats-tests`, which runs them inside in a container, so I'm pretty sure we can't have a "not in container" test here.
`test install_airflow` - the installation takes ages... Failure to install airflow should be easy to detect when building CI image. Perhaps we could stay safe and quick by stubbing pip and checking if it gets called with proper args? (e.g. https://github.com/jasonkarns/bats-mock)
I like the idea of testing these scripts, we definitely should have more tests! This PR is already somewhat bloated - if you're OK with that, I'd rather stick to two first tests in this file and add more in a separate PR.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-685158796
See the failing tests
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] stale[bot] commented on pull request #10682: [WIP]Cleaning scripts under 'scripts/in_container'
Posted by GitBox <gi...@apache.org>.
stale[bot] commented on pull request #10682:
URL: https://github.com/apache/airflow/pull/10682#issuecomment-751240006
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org