<commit_before>TestHelper = require "./test_helper"

describe 'deploy', ->

  doNotRunIfMode("fast")

  beforeEach =>
    @testHelper = new TestHelper
    @testHelper.prepare()

  afterEach ->
    if @testRunDone
      console.log "DONNNEEE"
      @session.kill()

  rightHereRightNow =>
    @testHelper = new TestHelper
    @testHelper.prepare()

    @testRunDone = false


  it "starts the deployment and makes", =>
    @session = @testHelper.runInProject
      args: ["deploy", "--debug"]

    started = false
    waitsFor =>
      started = @session.stdout.match("Making with hooks")

    runs ->
      expect( started ).toBeTruthy()

  it "creates dist/__appgyver_settings.json", =>
    settingsCreated = false
    waitsFor =>
      settingsCreated = @session.stdout.match("Creating dist/__appgyver_settings.json")

    runs ->
      expect( settingsCreated ).toBeTruthy()

  it "creates dist/config.ios.xml", =>
    iosConfigCreated = false
    waitsFor =>
      iosConfigCreated = @session.stdout.match("Creating dist/config.ios.xml...")

    runs ->
      expect( iosConfigCreated ).toBeTruthy()

  it "packages", =>
    packaged = false
    waitsFor =>
      packaged = @session.stdout.match("package exited with code 0")

    runs ->
      expect( packaged ).toBeTruthy()

  it "starts uploading to cloud", =>
    startsUploading = false
    waitsFor =>
      startsUploading = @session.stdout.match("Uploading Application to cloud")

    runs ->
      expect( startsUploading ).toBeTruthy()

  it "receives APPJSON", =>
    appJsonReceived = false
    waitsFor =>
      appJsonReceived = @session.stdout.match("RECEIVED APPJSON SYNC RESPONSE")

    runs ->
      expect( appJsonReceived ).toBeTruthy()

  it "opens URL to share.appgyver.com", =>
    urlOpened = false
    waitsFor =>
      urlOpened = @session.stdout.match("Opening URL https://share.appgyver.com/")

    runs ->
      expect( urlOpened ).toBeTruthy()

  it "completes deployment", =>
    deploymentCompleted = false
    waitsFor =>
      deploymentCompleted = @session.stdout.match("Deployment complete")

    runs ->
      expect( deploymentCompleted ).toBeTruthy()

  it "says that we are still working on the full team support", =>
    teamSupportAnnounced = false
    waitsFor =>
      teamSupportAnnounced = @session.stdout.match("We are working on full team support")

    runs ->
      expect( teamSupportAnnounced ).toBeTruthy()
      @testRunDone = true<commit_msg>separete killing<commit_after>TestHelper = require "./test_helper"

describe 'deploy', ->

  doNotRunIfMode("fast")

  beforeEach =>
    @testHelper = new TestHelper
    @testHelper.prepare()

  afterEach ->
    if @testRunDone
      console.log "DONNNEEE"
      @session.kill()

  rightHereRightNow =>
    @testHelper = new TestHelper
    @testHelper.prepare()

    @testRunDone = false


  it "starts the deployment and makes", =>
    @session = @testHelper.runInProject
      args: ["deploy", "--debug"]

    started = false
    waitsFor =>
      started = @session.stdout.match("Making with hooks")

    runs ->
      expect( started ).toBeTruthy()

  it "creates dist/__appgyver_settings.json", =>
    settingsCreated = false
    waitsFor =>
      settingsCreated = @session.stdout.match("Creating dist/__appgyver_settings.json")

    runs ->
      expect( settingsCreated ).toBeTruthy()

  it "creates dist/config.ios.xml", =>
    iosConfigCreated = false
    waitsFor =>
      iosConfigCreated = @session.stdout.match("Creating dist/config.ios.xml...")

    runs ->
      expect( iosConfigCreated ).toBeTruthy()

  it "packages", =>
    packaged = false
    waitsFor =>
      packaged = @session.stdout.match("package exited with code 0")

    runs ->
      expect( packaged ).toBeTruthy()

  it "starts uploading to cloud", =>
    startsUploading = false
    waitsFor =>
      startsUploading = @session.stdout.match("Uploading Application to cloud")

    runs ->
      expect( startsUploading ).toBeTruthy()

  it "receives APPJSON", =>
    appJsonReceived = false
    waitsFor =>
      appJsonReceived = @session.stdout.match("RECEIVED APPJSON SYNC RESPONSE")

    runs ->
      expect( appJsonReceived ).toBeTruthy()

  it "opens URL to share.appgyver.com", =>
    urlOpened = false
    waitsFor =>
      urlOpened = @session.stdout.match("Opening URL https://share.appgyver.com/")

    runs ->
      expect( urlOpened ).toBeTruthy()

  it "completes deployment", =>
    deploymentCompleted = false
    waitsFor =>
      deploymentCompleted = @session.stdout.match("Deployment complete")

    runs ->
      expect( deploymentCompleted ).toBeTruthy()

  it "says that we are still working on the full team support", =>
    teamSupportAnnounced = false
    waitsFor =>
      teamSupportAnnounced = @session.stdout.match("We are working on full team support")

    runs ->
      expect( teamSupportAnnounced ).toBeTruthy()

  it "kills the testrun", =>
    @testRunDone = true
{'fraction_non_alphanumeric': 0.11808790763621632, 'fraction_numerical': 0.00040510431436094796, 'mean_word_length': 2.969453376205788, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 66, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5684776', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1472, 'n_words': 358}