Skip to content

Commit

Permalink
Updating the unittesting env variable, added badges
Browse files Browse the repository at this point in the history
  • Loading branch information
asingamaneni committed Aug 7, 2023
1 parent e13a8ad commit eb92943
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/onpush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

env:
HADOOP_USER_HOME: 'hadoop'
UNIT_TESTING_ENV: 'spark_expectations_unit_testing_on_jenkins_bmx_server'
UNIT_TESTING_ENV: 'spark_expectations_unit_testing_on_github_actions'

steps:
- uses: actions/checkout@v3 # use latest version of the checkout action
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ mypy:
@poetry run mypy -p spark_expectations --exclude venv --exclude dist --exclude .idea

kafka-cluster-start:
ifeq ($(UNIT_TESTING_ENV), spark_expectations_unit_testing_on_jenkins_bmx_server)
ifeq ($(UNIT_TESTING_ENV), spark_expectations_unit_testing_on_github_actions)
. ./spark_expectations/examples/docker_scripts/kafka_cluster_start.sh
sleep 30
. ./spark_expectations/examples/docker_scripts/delete_kafka_topic.sh
. ./spark_expectations/examples/docker_scripts/create_kafka_topic.sh
endif

kafka-cluster-stop:
ifeq ($(UNIT_TESTING_ENV), spark_expectations_unit_testing_on_jenkins_bmx_server)
ifeq ($(UNIT_TESTING_ENV), spark_expectations_unit_testing_on_github_actions)
. ./spark_expectations/examples/docker_scripts/delete_kafka_topic.sh
. ./spark_expectations/examples/docker_scripts/kafka_cluster_stop.sh
rm -rf /tmp/kafka-logs
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Spark-Expectations

[![CodeQL](https://github.com/Nike-Inc/spark-expectations/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/Nike-Inc/spark-expectations/actions/workflows/codeql-analysis.yml)
[![build](https://github.com/Nike-Inc/spark-expectations/actions/workflows/onpush.yml/badge.svg?branch=main)](https://github.com/Nike-Inc/spark-expectations/actions/workflows/onpush.yml)


<img src="./docs/se_diagrams/logo.png" width="300" height="300">

The documentation for spark-expectations can be found [here]()
Expand Down
2 changes: 1 addition & 1 deletion spark_expectations/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def get_spark_session() -> SparkSession:

if (
os.environ.get("UNIT_TESTING_ENV")
== "spark_expectations_unit_testing_on_jenkins_bmx_server"
== "spark_expectations_unit_testing_on_github_actions"
) or (os.environ.get("SPARKEXPECTATIONS_ENV") == "local"):
builder = (
builder.config(
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_expectations.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
def fixture_setup_local_nsp_topic():
current_dir = os.path.dirname(os.path.abspath(__file__))

if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_jenkins_bmx_server":
if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_github_actions":

# remove if docker conatiner is running
os.system(f"sh {current_dir}/../../spark_expectations/examples/docker_scripts/docker_nsp_stop_script.sh")
Expand Down
2 changes: 1 addition & 1 deletion tests/sinks/plugins/test_nsp_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def fixture_setup_local_nsp_topic():
current_dir = os.path.dirname(os.path.abspath(__file__))

if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_jenkins_bmx_server":
if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_github_actions":

# remove if docker conatiner is running
os.system(f"sh {current_dir}/../../../spark_expectations/examples/docker_scripts/docker_nsp_stop_script.sh")
Expand Down
2 changes: 1 addition & 1 deletion tests/sinks/test__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def fixture_create_database():
def fixture_setup_local_nsp_topic():
current_dir = os.path.dirname(os.path.abspath(__file__))

if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_jenkins_bmx_server":
if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_github_actions":

# remove if docker conatiner is running
os.system(f"sh {current_dir}/../../spark_expectations/examples/docker_scripts/docker_nsp_stop_script.sh")
Expand Down
2 changes: 1 addition & 1 deletion tests/sinks/utils/test_collect_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def fixture_setup_local_nsp_topic():
current_dir = os.path.dirname(os.path.abspath(__file__))

if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_jenkins_bmx_server":
if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_github_actions":
# remove if docker conatiner is running
os.system(f"sh {current_dir}/../../../spark_expectations/examples/docker_scripts/docker_nsp_stop_script.sh")

Expand Down
2 changes: 1 addition & 1 deletion tests/sinks/utils/test_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def fixture_setup_local_nsp_topic():
current_dir = os.path.dirname(os.path.abspath(__file__))

if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_jenkins_bmx_server":
if os.getenv('UNIT_TESTING_ENV') != "spark_expectations_unit_testing_on_github_actions":
# remove if docker conatiner is running
os.system(f"sh {current_dir}/../../../spark_expectations/examples/docker_scripts/docker_nsp_stop_script.sh")

Expand Down

0 comments on commit eb92943

Please sign in to comment.